Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2007, 06:39 PM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default CSS Question

I have been using the following to make some links behave differently than others and seems to be working fine.

#p11 {font-family: "Times New-Roman"; padding-bottom: 2px; padding-top: 0px; padding-left: 3px;
font-size: 11pt; font-weight: normal; word-spacing: 2px; text-align: left;}

#p11 a:link {COLOR: #0000FF; TEXT-DECORATION: none; font-weight: bold}

#p11 a:active {COLOR: #0000FF; TEXT-DECORATION: underline; font-weight: bold}

#p11 a:visited {color: #A52549; TEXT-DECORATION: none; font-weight: bold}

#p11 a:hover {COLOR: #0000FF; text-decoration: underline}

Each line I want to do this, I have as
<p id="p11">Some Text Link Text</p>
<p id="p11">Some Text2 Link Text2</p>


This works fine, but I read that you are only supposed to use an id once. I could wrap it under one big

and insert
to control the line breaks, but that doesn't seem to be a very clean solution either.

I can't use a class, since that doesn't allow you to control the link behavior differently. Any ideas or just leave it?
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #2 (permalink)  
Old 03-28-2007, 05:38 AM
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Cornwall, UK
Posts: 862
speed RepRank 1
Default

You are correct that an id can only be used once, however you should be able to use a class as follows:

.p11 {font-family: "Times New-Roman"; padding-bottom: 2px; padding-top: 0px; padding-left: 3px;
font-size: 11pt; font-weight: normal; word-spacing: 2px; text-align: left;}

.p11 a:link {COLOR: #0000FF; TEXT-DECORATION: none; font-weight: bold}

.p11 a:active {COLOR: #0000FF; TEXT-DECORATION: underline; font-weight: bold}

.p11 a:visited {color: #A52549; TEXT-DECORATION: none; font-weight: bold}

.p11 a:hover {COLOR: #0000FF; text-decoration: underline}

<p class="p11">Some Text Link Text</p>
<p class="p11">Some Text2 Link Text2</p>

If you find it doesn't then a test page would be most helpful in diagnosing the problem.
__________________
US & UK Web Hosting with hourly backups | Hosting Affiliate Scheme | Web Directory 2 for 1 Offer
Reply With Quote
  #3 (permalink)  
Old 03-28-2007, 10:22 AM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default

I will give that a try. And if it doesn't work I will post a link to a test page.

Thank you,
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #4 (permalink)  
Old 03-28-2007, 11:10 AM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default

Thanks speed. Success!
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #5 (permalink)  
Old 04-14-2007, 12:05 AM
WebProWorld Veteran
 

Join Date: Aug 2003
Location: California,USA
Posts: 373
drummin RepRank 0
Default

Yes,
When Speed speaks, we listen.
He's the man.
Drummin
Reply With Quote
  #6 (permalink)  
Old 04-14-2007, 07:55 PM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default

And that little tidbit, allowed me to greatly reduce my CSS. I was able to set a base behavior and then just change the items such as font-size, decoration, etc for the classes that needed something different.
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0