Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

attached style sheet not being applied correctly 1

Status
Not open for further replies.

CMcC

Programmer
Feb 5, 2002
196
0
0
US
Hello - newbie to DW8 and have only 3 days seminar experience. I created a .CSS that contains div tags with different colors, sizes. I attached the .CSS by link. Why is it that when I create a new page with text and attach the sheet - I dont see the div tags? The other properties are applied (font size, color) but not the div tags.
below is the code for the CSS. Any suggestions?
Code:
p {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 0.95em;
	color: #333333;
	line-height: 20px;
}
h1 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 1.4em;
	color: #000033;
}
h2 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 1.2em;
	color: #000033;
}
h3 {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-size: 1.1em;
	color: #000033;
}
.boldit {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 0.95em;
	font-weight: bold;
	color: #990000;
	letter-spacing: .1em;
}
strong em {
	font-size: .9em;
	color: #336666;
}
a:link {
	color: #CC3366;
}
a:visited {
	color: #660000;
}
#maintext {
	background-color: #F7EEDF;
	padding: 10px;
	float: right;
	width: 500px;
}
#imgtop {
	width: 700px;
}
#leftnav {
	background-color: #F7EEDF;
	padding: 10px;
	float: left;
	width: 150px;
}
#footer {
	width: 700px;
}
#wrapper {
	width: 700px;
	margin: auto;
}
 
You have to assign the ids you have specified in your stylesheet to the divs in your html file.
e.g.
Code:
<div [COLOR=red]id="wrapper"[/color]>
<div [COLOR=red]id="leftnav"[/color]>
</div>
...
</div>

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
By the way, the ids you have specified can be applied to a variety of tags, not just div tags.
e.g.
Code:
<p id="footer">blah blah blah</p>
is also a valid use of your styles.

Keep in mind that an id (#imgtop) can only be used once per html page, while a class (.imgtop) could be reused.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hi there traingamer. I thought that if I defined the div tag in a .css file that would do the trick. I didnt give it an id when I created the div tag. I'm learning from a book and it said to select the text - Insert - Div Tag - Select New CSS Style - then named it with #divtagname.
If I want all the pages in my site to have the same div tags and placement - do I have to create with an ID?
thanks so much for your help.
 
Hi again Traingamer.
I believe I have gotten myself confused. I think I need to create a template with editable regions and apply that to my pages. What I was wanting to happen, was to create a navigational bar that can be seen on all pages within my site. I am looking into that now. Thanks for your help.
cmcc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top