Forum Moderators: not2easy

Message Too Old, No Replies

adding a rule to the stylesheet as a class

adding a rule to the stylesheet as a class

         

amythepoet

8:11 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I have a line that appears on every page, I understand that I need to add a rule to my stylesheet as a class and do not know how to do that.

This is what I need to add:

<p align="center"><a href="order.html"><img src="imagery/order-now.gif" alt="Click Here To Order One Of Our Blue Widgets, GreenWidgets and Red Widgets" width="200" height="50" border="0" /></a></p>

I keep getting errors and don't know what to do

DanA

8:17 pm on Jan 20, 2006 (gmt 0)

10+ Year Member



I'm not sure that you need a class (you can use an id as long as it appears only once per page)
you can try :
p.style{
text-align:center;
}
p.style img{
border:0;
width:200px;
height:50px;
}

<p class="style"><a href="order.html"><img src="imagery/order-now.gif" alt="Click Here To Order One Of Our Blue Widgets, GreenWidgets and Red Widgets" /></a></p>

amythepoet

8:22 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh Ok, I will try that, thank you.

Now I put that in on the stylesheet, correct?

What about the line that appears on every page that I mentioned in my previous email?

DanA

8:30 pm on Jan 20, 2006 (gmt 0)

10+ Year Member



Add the rules in the stylesheet
p.style{
text-align:center;
}
p.style img{
border:0;
width:200px;
height:50px;
}

and the html code in the body of your html in every page.

amythepoet

9:32 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I did that and the page appears in one long column, rather than in two, which I what I started with.

It's a mess

sldesigns

2:30 am on Jan 23, 2006 (gmt 0)

10+ Year Member



amythepoet,
it could be that the width of the image is throwing off the column?
Perhaps you could post the code, and let us know what the errors were -- validation errors? Since the css was specific to that one area it shouldn't have affected anything else. What it did do was put the info on how to display in the css, which could then be separated from the html and linked from every page.
The html pulling in the graphic and the link still needs to be on every page, unless there is some sort of inclusion method, a script or php or something that is outside the focus of css.
Css will only show what something will look like, it can't add text or links.