Log in

View Full Version : Help with a <div> tag



GhettoT
12-02-2006, 11:51 PM
OK, so i want add a page title div. I want it to work much how the Chrome CSS Drop Down Menu (http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm) works in that you make a 3px. X 50px. Image that will make up a background around the text that you assign. Like how this (http://www.bhrobotics.com/) page puts a background behind the "Mission Statement" I have the CSS semi coded and it looks like this:


DIV.title{
border: 1px solid #BBB;
background: url(PATH/TO/BG_IMAGE.gif) center center repeat-x;
}
But how would i add in the HTML so that the title would show up?
Would it look like:


<div class="title"><b>PAGE TITLE HERE</b></div>

Yes, i know their is the

<head>
<title>TITLE_HERE</title>
But I want to have a page title thing in the actual page as well.

Any ideas?

-GT

mburt
12-03-2006, 12:13 AM
All you have to do in the css is set the class properly:

.title{
border: 1px solid #BBB;
background: url(PATH/TO/BG_IMAGE.gif) center center repeat-x;
}

The DIV you had there wasn't necessary. And your markup should look like this:

<div class="title"><b>PAGE TITLE HERE</b></div>
(the same as before)

GhettoT
12-03-2006, 12:44 AM
Oh yes, i know the DIV.[div name] wasn't neccesary, i just use it to keep all my CSS neat. (mostly because other eople on my web team are HTML/CSS illiterate.)
Thanks for confirming my code!

-GT

mburt
12-03-2006, 12:55 AM
No prob.