User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 422,821 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,264 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 3490 | Replies: 17
Reply
Join Date: Oct 2006
Location: UK
Posts: 143
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

make css apply to a chunk of html

  #1  
Nov 3rd, 2006
hi all!!

This is my text only back-up menu at the bottom of my page, but the colours from my origional external css sheet look bad on its background, so how do i make them a different colour? Here is the code for the hyperlink:

<tr>
    <td>&nbsp;</td>
    <td height="20" class="stylesheet3" valign="bottom" body><div align="center" ><font face="Arial, Helvetica, sans-serif"><a href="http://www.themepics.co.uk/" ><font size="-2">Home</font></a><font size="-2"> 
        | <a href="<A href="http://www.themepics.co.uk/gallery">Gallery</a">http://www.themepics.co.uk/gallery">Gallery</a> | <a href="<A href="http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe">http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe 
        Gallery</a> | <a href="<A href="http://www.themepics.co.uk/art-packages">Art">http://www.themepics.co.uk/art-packages">Art Packages</a> 
        | <a href="<A href="http://www.themepics.co.uk/customise">Customise</a">http://www.themepics.co.uk/customise">Customise</a> | <a href="<A href="http://www.themepics.co.uk/buy">Buy</a">http://www.themepics.co.uk/buy">Buy</a> 
        | <a href="<A href="http://www.themepics.co.uk/process">The">http://www.themepics.co.uk/process">The Process</a> | <a href="<A href="http://www.themepics.co.uk/offers">Special">http://www.themepics.co.uk/offers">Special 
      Offers</a></font></font></div></td>
    <td>&nbsp;</td>
  </tr>

Here is my css code that i have at the moment:

.stylesheet1 {
 font-family: arial;
 font-size: 12px;
 font-style: normal;
 line-height: normal;
 font-variant: normal;
 color: #000000;
 text-align: left;
}
a:link{
color: #990000;
text-decoration: none;
}
a:visited{
color: #AF1E2D;
text-decoration: none;
}
a:hover{
color: #808080;
text-decoration: underline;
 

and here is how i want the hyperlinks to look like:

a:link{
color: #000000;
text-decoration: none;
}
a:visited{
color: #333333;
text-decoration: none;
}
a:hover{
color: #999999;
text-decoration: underline;
 

Thanks!!!
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Posts: 173
Reputation: BinaryMayhem is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 9
BinaryMayhem BinaryMayhem is offline Offline
Unverified User

Re: make css apply to a chunk of html

  #2  
Nov 3rd, 2006
CSS:
 
a.backup:link{
color: #000000;
text-decoration: none;
}
a.backup:visited{
color: #333333;
text-decoration: none;
}
a.backup:hover{
color: #999999;
text-decoration: underline;
HTML:
    <td height="20" class="stylesheet3" valign="bottom" body><div align="center" ><font face="Arial, Helvetica, sans-serif"><a class="backup" href="http://www.themepics.co.uk/" ><font size="-2">Home</font></a><font size="-2"> 
        | <a href="<A class="backup" href="http://www.themepics.co.uk/gallery">Gallery</a">http://www.themepics.co.uk/gallery">Gallery</a> | <a class="backup" href="<A href="http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe">http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe 
        Gallery</a> | <a class="backup" href="<A href="http://www.themepics.co.uk/art-packages">Art">http://www.themepics.co.uk/art-packages">Art Packages</a> 
        | <a href="<A class="backup" href="http://www.themepics.co.uk/customise">Customise</a">http://www.themepics.co.uk/customise">Customise</a> | <a href="<A class="backup" href="http://www.themepics.co.uk/buy">Buy</a">http://www.themepics.co.uk/buy">Buy</a> 
        | <a href="<A class="backup" href="http://www.themepics.co.uk/process">The">http://www.themepics.co.uk/process">The Process</a> | <a href="<A class="backup" href="http://www.themepics.co.uk/offers">Special">http://www.themepics.co.uk/offers">Special 
      Offers</a></font></font></div></td>
Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 143
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Troubleshooting Re: make css apply to a chunk of html

  #3  
Nov 4th, 2006
[code<a href="<A class="backup" href="http://www.themepics.co.uk/gallery">[/code]


Ok cos there is a small glitch in the html i put class="backup" after the <a and before the href="... . I pasted the css into my style sheet i was using for the page, which already contains info about how my hyperlinks should be. this is what each of my things look like at the moment:
.stylesheet1 {
 font-family: arial;
 font-size: 12px;
 font-style: normal;
 line-height: normal;
 font-variant: normal;
 color: #000000;
 text-align: left;
}
a:link{
color: #990000;
text-decoration: none;
}
a:visited{
color: #AF1E2D;
text-decoration: none;
}
a:hover{
color: #808080;
text-decoration: underline;
a.backup:link{
color: #000000;
text-decoration: none;
}
a.backup:visited{
color: #333333;
text-decoration: none;
}
a.backup:hover{
color: #999999;
text-decoration: underline;
}

    <td height="20" class="stylesheet3" valign="bottom" body><div align="center" ><font face="Arial, Helvetica, sans-serif"><a class="backup" href="http://www.themepics.co.uk/" ><font size="-2">Home</font></a><font size="-2"> 
        | <a class="backup" href="<A href="http://www.themepics.co.uk/gallery">Gallery</a">http://www.themepics.co.uk/gallery">Gallery</a> | <a class="backup" href="<A href="http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe">http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe 
        Gallery</a> | <a class="backup" href="<A href="http://www.themepics.co.uk/art-packages">Art">http://www.themepics.co.uk/art-packages">Art Packages</a> 
        | <a class="backup" href="<A href="http://www.themepics.co.uk/customise">Customise</a">http://www.themepics.co.uk/customise">Customise</a> | <a class="backup" href="<A href="http://www.themepics.co.uk/buy">Buy</a">http://www.themepics.co.uk/buy">Buy</a> 
        | <a class="backup" href="<A href="http://www.themepics.co.uk/process">The">http://www.themepics.co.uk/process">The Process</a> | <a class="backup" href="<A href="http://www.themepics.co.uk/offers">Special">http://www.themepics.co.uk/offers">Special 
      Offers</a></font></font></div></td>

Thanks again.
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Join Date: Jun 2004
Posts: 173
Reputation: BinaryMayhem is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 9
BinaryMayhem BinaryMayhem is offline Offline
Unverified User

Re: make css apply to a chunk of html

  #4  
Nov 4th, 2006
hmm, well I quickly edited the code you had and didn't really look at your HTML. it appears you had <A href="<a href="http://...">....</a>... </a>

you should really be neater with your html. also, font tags and tables are depreciated. you should be using all css. font-family:arial; font-size:medium;

any who, here is what you should have. I straigted it up really quick.
<td height="20" class="stylesheet3" valign="bottom" body><div align="center" ><font face="Arial, Helvetica, sans-serif">
<a class="backup" href="http://www.themepics.co.uk/" >
<font size="-2">Home</font></a><font size="-2"> 
        | <A class="backup" href="http://www.themepics.co.uk/gallery">Gallery</a">
        | <a class="backup" href="http://www.themepics.co.uk/adobe%20photo%20gallery/adobe_gallery.htm">Adobe Gallery</a>
        | <A class="backup" href="http://www.themepics.co.uk/art-packages">Art Packages</a> 
        | <A class="backup" href="http://www.themepics.co.uk/customise"Customise</a>
        | <A class="backup" href="http://www.themepics.co.uk/buy">Buy</a> 
        | <A class="backup" href="http://www.themepics.co.uk/process">The Process</a>
        | <A class="backup" href="http://www.themepics.co.uk/offers">Special Offers</a>
</font></font></div></td>
Reply With Quote  
Join Date: Dec 2004
Posts: 1,590
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 35
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: make css apply to a chunk of html

  #5  
Nov 4th, 2006
You mean "deprecated", right? Font tags are. Tables are not. For certain pages/applications, tables are still the best way to control layout. This forum (any forum) for instance, uses CSS extensively, but the overall structure of the site is tabular.
Reply With Quote  
Join Date: Jun 2004
Posts: 173
Reputation: BinaryMayhem is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 9
BinaryMayhem BinaryMayhem is offline Offline
Unverified User

Re: make css apply to a chunk of html

  #6  
Nov 4th, 2006
yes, I was mainly referring to the font tags, however; some people make it a habbit to lay a site out with tables when they should be using css.

Tables should be used to mark up truly tabular information ("data tables"). Content developers should avoid using them to lay out pages ("layout tables"). Tables for any use also present special problems to users of screen readers (refer to checkpoint 10.3).

http://www.w3.org/TR/WAI-WEBCONTENT/#gl-table-markup

Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 143
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: make css apply to a chunk of html

  #7  
Nov 4th, 2006
Originally Posted by BinaryMayhem View Post
yes, I was mainly referring to the font tags, however; some people make it a habbit to lay a site out with tables when they should be using css.


oh well i dont really understand how to layout pages with css. I find tables are good because you can do things like make all text line up or have a pic as a border to a text box etc. Its also nice to use with templates on DWMX cos its very fast to edit.

Do you know of any good sites which can teach me to use css well?

thanks,
Max
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Join Date: Jun 2004
Posts: 173
Reputation: BinaryMayhem is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 9
BinaryMayhem BinaryMayhem is offline Offline
Unverified User

Re: make css apply to a chunk of html

  #8  
Nov 4th, 2006
your not gona learn css over night. it will take time and experince to understand what is going on. your best off learning from what other peoples work.

here are some quick links.

http://www.glish.com/css/
http://www.tjkdesign.com/articles/on...ss_layouts.asp
http://www.w3schools.com/css/default.asp
http://www.sitepoint.com/subcat/css
http://www.digital-web.com/articles/fluid_thinking/

everthing is working correctly now right?
good luck.
Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 143
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: make css apply to a chunk of html

  #9  
Nov 5th, 2006
well almost but ill try to learn it and do it myself because i will be able to use it in the future more thanks for your help.

Max.
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Join Date: Jul 2006
Location: Deptford, London
Posts: 954
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 48
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: make css apply to a chunk of html

  #10  
Nov 6th, 2006
Originally Posted by BinaryMayhem View Post
yes, I was mainly referring to the font tags, however; some people make it a habbit to lay a site out with tables when they should be using css.


i'm going to absolutely disagree with you (and the w3c/wai) there. content is data; and until there's an effective replacement for tables, there's no way to do certain things without them.

for example, to make a page that fills the horizontal width of a screen always, has blocks of text and fixed sized blocks:

tables expand downwards rather than jump underneath each other, if the text is huge, the table compensates and all other parts of the table reflect that, and they degrade well if you're careful. They separate a page into clear areas, and you know they'll always be in the correct (relative) position, rather than having to "lock" or "push" things into place with css, which imo should be something that other people can change safely without knowing the inner workings of the designer's mind.

EDIT: i gotta add, table cells in xhtml strict/xhtml transitional/html 4 strict/transitional are possibly the only blocks that support vertical-align:center; that's a big thing.

solutions i've seen to split pages up how i'd like with divs/css have tons more markup than solutions with tables and css.

that one line by the wai is somewhat overquoted... the w3c have a good side and a bad side.. the good side provides a wealth of technical information and guidelines, and brings unrelated projects into a cohesion... the bad side trys to promote those guidelines as irrefutable law.
Last edited by MattEvans : Nov 6th, 2006 at 2:15 pm.
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 10:29 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC