How do i add an image as my header in css?
CSS
Started by dakota367, Jul 15 2006 11:06 PM
5 replies to this topic
#1
Posted 15 July 2006 - 11:06 PM
#2
Posted 15 July 2006 - 11:11 PM
#div
{
background-image: url(url_to_image.gif);
width: 800px;
height: 200px;
}
just make the nessary changes
#3
Posted 16 July 2006 - 04:55 PM
Or you could infact use the img tag still just hold it in your header class or ID.
I use Coolaids way but it's always better to have more than one way to implement something within a webpage so the more solutions to one answer means the better.
<style type="text/css">
<!--
.headerclass {
width: 800px;
height: 200px;
border: 1px solid #000;
)
/* The above is a CSS Selector Class
While the below is a CSS ID..
You select them both nearly the same
but i'm guessing you know this. */
#headerid {
width: 800px;
height: 200px;
border: 1px solid #000;
}
--!>
</style>
</head>
<body>
<div class="headerclass"><img src="/path/to/image.gif" alt="Your Alt" title="Your Title" /></div>
<div id="headerid"><img src="/path/to/image.gif" alt="Your Alt" title="Your Title" /></div>
</body>
</html>
I use Coolaids way but it's always better to have more than one way to implement something within a webpage so the more solutions to one answer means the better.
#4
Posted 16 July 2006 - 05:52 PM
i agree, but let me just add on a little fact if i may
(i'm not tyring to uh... counter what you said, just adding on)
the reason why someone would use the <img> tag is for actual content, for layout purposes the semantics would make you put the image as a background in a div.
css - separates content from design
the reason why someone would use the <img> tag is for actual content, for layout purposes the semantics would make you put the image as a background in a div.
css - separates content from design
#5
Posted 17 July 2006 - 02:36 PM
Well im making a blog for blogspot and i am trying to have an image header seporate from the rest of the blog? If that makes sence.
#6
Posted 18 July 2006 - 07:49 PM
Then I would suggest from what you just said to do it the way coolaid originally suggested, and make the necessary changes according to your filename, #div name etc...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
