Personal Loans - Business Credit Card - Loans - Loans - Buy Shares

PDA

View Full Version : css hyperlink help


Solicitors Mortgages
Jan 13th 2005, 3:08 am
i have a table that has 96 hyperlinks in it, how can i set the hyperlink properties of the whole table so that i dont need to write
<a class="mystyle" in front of all 96 hyperlinks? :confused:

SEbasic
Jan 13th 2005, 3:13 am
table a:link {
style info here: like this;
}

Solicitors Mortgages
Jan 13th 2005, 3:34 am
thanks mate, it must be early as that went right over me.
so i have to write all of this in there? on the page?

table a:link {color: #000080}
a:visited {color: #000080}
a:hover {color: #C0C0C0}
a:active {color: #000080
}

Solicitors Mortgages
Jan 13th 2005, 3:54 am
here's an example...i just cant figure where to insert the code you said :mad:

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 3px solid #000080;" width="750" id="tablez5">
<tr>
<td class="tablez5" width="250">
<a class="aa" href="PLACE-Car-Sales-cars-sale-dealers.htm">Car Sales</a><br>
<a class="aa" href="PLACE-Car-Repair-MOT-mechanics.htm">Car Repair &amp; MOT</a><br>
<a class="aa" href="PLACE-articles-for-sale-classifieds.htm">Articles for Sale</a><br>
<a class="aa" href="PLACE-Rent-Rooms-to-Let-accommodation.htm">Rented Accommodation</a><br>
<a class="aa" href="PLACE-Property-for-Sale-houses-estate-agents.htm">Property for Sale</a><br>
<a class="aa" href="PLACE-Job-Vacancies-Full-time-jobs.htm">Job Vacancies Full time</a><br>
<a class="aa" href="PLACE-Job-Vacancies-Part-time-jobs.htm">Job Vacancies Part time</a><br>
<a class="aa" href="PLACE-Job-Vacancies-60+-jobs.htm">Jobs for Age 60+</a><br>
<a class="aa" href="PLACE-Motorbikes-mopeds-scooters-accessories.htm">Motorbikes Sale/Repair</a><br>
<a class="aa" href="PLACE-Computer-Services-Upgrades-repairs.htm">Computer Services</a><br>
<a class="aa" href="PLACE-Travel-Agents-Holidays-holiday.htm">Holidays</a><br>
<a class="aa" href="PLACE-Weddings-wedding-arrangements-dresses.htm">Weddings</a><br>
<a class="aa" href="PLACE-Funerals-Funeral-Directors-Services.htm">Funerals</a><br>
<a class="aa" href="PLACE-Cleaners-office-domestic-cleaning.htm">Cleaners</a><br>
<a class="aa" href="PLACE-Garden-Gardening-gardeners.htm">Garden Services</a><br>
<a class="aa" href="PLACE-Domestic-Kitchen-Appliance-Service.htm">Domestic Appliances &amp; Repair</a><br>
<a class="aa" href="PLACE-business-Classifieds-listings-businesses.htm">Assorted Businesses</font></a><br>
<a class="aa" href="PLACE-repairs-TV-hi-fi-Video-Repair.htm">TV Hi-fi Video</a><br>
&nbsp;</td>
<td class="tablez5" width="250">
<a class="aa" href="PLACE-Decorators-painters.htm">Decorators</a><br>
<a class="aa" href="PLACE-Plumbers-plumbing-Gas-fitters.htm">Plumbers &amp; Gas</a><br>
<a class="aa" href="PLACE-Electricians-electrician.htm">Electricians</a><br>
<a class="aa" href="PLACE-Tradesmen-interior.htm">Tradesmen-interior</a><br>
<a class="aa" href="PLACE-Tradesmen-exterior.htm">Tradesmen-exterior</a><br>
<a class="aa" href="PLACE-Block-Paving-Driveways-skips-skip-hire.htm">Driveways &amp; Skip Hire</a><br>
<a class="aa" href="PLACE-builders-tool-hire.htm">Builders</a><br>
<a class="aa" href="PLACE-UPVC-Windows-Conservatories.htm">Windows &amp; Conservatories</a><br>
<a class="aa" href="PLACE-Carpet-Flooring-fitters-carpets.htm">Carpet &amp; Flooring</a><br>
<a class="aa" href="PLACE-Taxi-Car-Rental-hire-taxis.htm">Taxi &amp; Car Rental</a><br>
<a class="aa" href="PLACE-Sports-Leisure-football-club.htm">Sports &amp; Leisure</a><br>
<a class="aa" href="PLACE-Health-Fitness-clubs-doctors.htm">Health &amp; Fitness</a><br>
<a class="aa" href="PLACE-Hair-Beauty-salons.htm">Hair &amp; Beauty</a><br>
<a class="aa" href="PLACE-Child-Nursery-Equipment.htm">Child &amp; Nursery</a><br>
<a class="aa" href="PLACE-baby-babies-childcare.htm">Baby Stuff</a><br>
<a class="aa" href="PLACE-Kids-Parties-Activities.htm">Kids Parties &amp; Activities</a><br>
<a class="aa" href="PLACE-Pets-Pet-Shops-vets.htm">Pets &amp; Animals</a><br>
<a class="aa" href="PLACE-Local-Hotels-bed-breakfast.htm">Local Hotels</a></td>
<td class="tablez5" width="250">
<a class="aa" href="PLACE-Entertainment-days-out-night-clubs.htm">Entertainment</a><br>
<a class="aa" href="PLACE-Theatre-Cinema-listings.htm">Theatre &amp; Cinema</a><br>
<a class="aa" href="PLACE-Restaurants-Take-away-takeaway.htm">Restaurant &amp;Takeaway</a><br>
<a class="aa" href="PLACE-Hobbies-Clubs-Societies.htm">Hobbies Clubs &amp; Societies</a><br>
<a class="aa" href="PLACE-Local-Events.htm">Local Events</a><br>
<a class="aa" href="PLACE-adult-education-schools.htm">Education</a><br>
<a class="aa" href="PLACE-arts-crafts.htm">Arts &amp; Crafts</a><br>
<a class="aa" href="PLACE-Music-Shops-lessons.htm">Music &amp; Lessons</a><br>
<a class="aa" href="PLACE-Financial-Advice-advisors-mortgage.htm">Financial Services</a><br>
<a class="aa" href="PLACE-Solicitors-Advice-legal.htm">Solicitors &amp; Advice</a><br>
*<a class="aa" target="_blank" href="../../internet-shops.htm">Internet shopping</a>*<br>
<a class="aa" href="PLACE-Fashion-Clothing.htm">Fashion &amp; Clothing</a><br>
<a class="aa" href="PLACE-books-book-sellers-shops.htm">Books &amp; Literature</a><br>
<a class="aa" href="PLACE-Mobile-Phones.htm">Mobile Phones</a><br>
<a class="aa" href="PLACE-Business-Opportunities-businesses-for-sale.htm">Business Opportunities</a><br>
<a class="aa" href="PLACE-Business-Office-Supplies.htm">Office Supplies</a><br
>*<a class="aa" href="PLACE-Links-Numbers.htm">Useful Numbers &amp; Links</a>*<br>
</td>
</tr>
</table>

xml
Jan 13th 2005, 4:02 am
You could remove the class="aa" for the links saving bandwidth and loading times.

Instead u could use:

#tablez5 a:link, #tablez5 a:visited, #tablez5 a:active {
color: #000080
}

#tablez5 a:hover {
color: #C0C0C0
}

SEbasic
Jan 13th 2005, 4:03 am
Put this in the head of the page,

<link rel="stylesheet" href="Location of style sheet" type="text/css" title="default" />

In the .css file, place this

table a:link {color: #000080}
table a:visited {color: #000080}
table a:hover {color: #C0C0C0}
table a:active {color: #000080}

That should do it...

If not, try this
td a:link {color: #000080}
td a:visited {color: #000080}
td a:hover {color: #C0C0C0}
td a:active {color: #000080}

or this
tr a:link {color: #000080}
tr a:visited {color: #000080}
tr a:hover {color: #C0C0C0}
tr a:active {color: #000080}

I think one of them should work ;)

Solicitors Mortgages
Jan 13th 2005, 4:07 am
ok...i will have a play..thanks Guys...its just that in 2 hours cant find any examples on the web :(
i even went to this w3 tutorial page......http://www.w3schools.com/css/default.asp
and viewed the source to see how they set the properties on their hyperlinks...

and they have <a class="left" EVERYWHERE...
huh...some tutorial that is...even w3 waste bandwidth.!!

Solicitors Mortgages
Jan 13th 2005, 6:05 am
all done, thanx guys,

used XML's, worked fine :)

i have quite a lot of stuff on my CSS as there are a lot of styles on my pages,
it is now 4.7Kb

do i assume that i shouldn't go any more?
whats defined as a 'big Kb' stylesheet?

xml
Jan 13th 2005, 6:18 am
4.7Kb isn't that bad really.

I pass my CSS files thru the PHP interpreter to compress by putting:

AddHandler application/x-httpd-php .css

In my .htaccess file, then in my CSS file I put:

<?php
ob_start('ob_gzhandler');
header('Content-Type: text/css');
?>body {
margin: 0 0 15px 0;
padding: 0;
background-color: white;
font-family: Arial, Helvetica, Sans-Serif;
cursor: default;
font-size: 13px
}

This gzips the CSS file contents.

Check http://www.feedsfarm.com/s.css

Comes up as 1.27 KB for me, in reality the file is 5.35 KB.

Solicitors Mortgages
Jan 13th 2005, 6:27 am
<<I pass my CSS files thru the PHP interpreter>>
ROTFLMAO !!..yeh.. and in my wildest dreams,
i have trouble doing hyperlinks in a table!

Well when i need it rebuilt again, you can give me a quote...
Manchester's not so far, so expect a knock!

nice one xml :)

GEM

J.D.
Jan 13th 2005, 10:32 am
#tablez5 a:link, #tablez5 a:visited, #tablez5 a:active {
color: #000080
}In CSS # denotes an ID, not a class. Since the original source uses classes, not IDs:

<td class="tablez5" width="250">the style should be written like this:

.tablez5 a:link, .tablez5 a:visited, .tablez5 a:active {color: #000080}

J.D.

xml
Jan 13th 2005, 11:07 am
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 3px solid #000080;" width="750" id="tablez5">

tablez5 is the item ID ;)

J.D.
Jan 13th 2005, 12:41 pm
tablez5 is the item ID ;)You are right. My bad. What threw me off is that the same name is used for the class name :)

J.D.