Jump to content


CSS


5 replies to this topic

#1 dakota367

    Young Padawan

  • Members
  • Pip
  • 8 posts

Posted 15 July 2006 - 11:06 PM

How do i add an image as my header in css?

#2 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 15 July 2006 - 11:11 PM

#div
{
	background-image: url(url_to_image.gif);
	width: 800px;
	height: 200px;
}

just make the nessary changes :o

#3 Net-Margin

    Young Padawan

  • Members
  • Pip
  • 55 posts
  • Location:United Kingdom
  • Interests:My main interests would have to be general computing and digital imaging; but I also enjoy Website Design and animation.<br /><br />Away from the computer I enjoy watching Science programs and astronomy.<br /><br />My main skills would have to be XHTML and Web Marketing but I also have good knowledge in CSS, Search Engine Optimization and Javascript.<br /><br />I own the Macromedia Studio 8 which I believe is one of the best packages ever. I also use Visual Basic 2005 Express Edition.

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.

<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 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

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 :D

#5 dakota367

    Young Padawan

  • Members
  • Pip
  • 8 posts

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 Stephen

    Young Padawan

  • Members
  • Pip
  • 118 posts
  • Location:United Kingdom

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...

:D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users