You are here: Re: Link style over riding another « HTML « IT news, forums, messages
Re: Link style over riding another

Posted by gil on 04/25/06 00:18

The order of specifying the styles determines which ones will be used.
The last style specified for an element will be the one used.

BUT, You should be able to create styles for differently identified
div's allowing you to have different link styles, even on the same page.

on external style sheet (preferred), or internal (on every html page)

....
#header a {text-decoration: none}
#header a:link {color: green;}
....
....
#main a {text-decoration: underline;}
#main a:link {color: red;}
....
etc.


in your body
<div id="header"> header code with links </div>
<!--should use the styles in #header section of stylesheet-->

<div id="main"> main page code with links </div>
<!--should use the style in #main section of stylesheet-->

anything inside the div will use styles specified as id. Remember, you
can only use the same id attribute once per html document.

Gil

At approximately 2006/04/24 16:34, Ian Davies typed these characters:

> Hello
>
> I want to display more than one style of link on a webpage using CSS but an
> finding it impossible to do. I wish the menu bar at the top to have
> different style of link to those links in the main body.
>
> I thought this would be easy as I have a header page in a separate html to
> the body (to make it easy to display the header on each page). However the
> link style in the body over rides the link style in the header. I was hoping
> they would remain local to their respective pages.
>
> How can I resolve this please
>
> Ian
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация