|
#1
|
|||
|
|||
|
Well,
just have a look at this style sheet <STYLE> body{ a:link{color:brown;text-decoration:underline} a:hover{color:sandybrown; size:110%; text-decoration:none} } </style> Is there anything wrong? I am not able to get the required output. In any of the browser whatsoever. Any suggestions would be appreciated. |
|
#2
|
||||
|
||||
|
size: is not valid, use font-size:
also, I have seen it happen that with a:hover and a:link you need to define a:active and a:visited as well and in order - a:link a:active a:visited a:hover |
|
#3
|
|||||
|
|||||
|
Quote:
HTML Code:
<style type="text/css">
Quote:
Code:
body a:link {
Quote:
Quote:
Quote:
Mike |
|
#4
|
|||
|
|||
|
First of all thanks for that huge explanation.
i wanted to say that i had designed another page using the same elements as they are shown here.but in that page this style sheet produced the out come. Is there any hard and fast rule to use all the elemants as you specified. that is- a:link a:active a:visited a:hover as well as to specify the style type.which i have seen normally people on many websites don't care for. My problem was solved by just giving a space between body and the first curly braces. To know about color:sandybrown just go to: http://www.w3schools.com/html/html_colornames.asp lastly, Is it necessary to use pt,px for size instead of percentage ,which i have seen many people using it.Is it better to use hex or r,g,b code instead of color names and that too only the 256 colors. And, The hover code might not be used by dynamic drive.but it is commonly used by almost all the sites now-a-days. bye the way thanks a lot. |
|
#5
|
||||||
|
||||||
|
Quote:
HTML isn't a language where emulation is meaningful, which is why I'm dismayed at the number of people who want to "hide" their source code. My document is different to yours, so why on Earth would I want to use the same mark-up!? OK, someone might want to use the same appearance, but they don't need to look at the mark-up to do that. Quote:
Code:
body {
a:link {
/* ... */
}
}
Quote:
Quote:
Note that fonts should never be sized this way as it prevents IE users from resizing the text if they need to (another IE bug). Instead, size font with percentages and use em or ex units when positioning relative to text. Percentage positioning should be used when it's logical. It's usually preferred because it produces more fluid layouts. Quote:
Quote:
Mike |
|
#6
|
|||
|
|||
|
I have been following this thread with interest and I also need an answer to colouring links.
I have sections on the page which are different colours. Dark blue on one side and light blue on the other. I want the dark blue side links to be different colours to the right side. Can I use a class to change them and if so what would be the correct coding be. The page is laid out in tables and I want to use a style sheet. I have tried using the DIV tag but i think I must be using it wrong as it doesnt work. could i have something along the lines of: <p class="a:link right">link code</p> <p class="a:link left">link code</p> If i can, how do i code it into the external style sheet. Thanks for helping |
|
#7
|
|||
|
|||
|
Quote:
Why do you have two columns? Is there any particular reason? For example, if the right-hand column contained external links (probably doesn't, but stay with me ), 'external-links' would be a much better class name than 'right'.So, given: HTML Code:
<p class="left"><a href="...">...</a></p> Code:
p.left a {
/* Foreground and background colours should always
* be specified together. This is true even when the
* background colour may not change from the colour
* specified by ancestors. You can use the values
* transparent or inherit in cases like this.
*
* background-color: #rrggbb; */
color: #1a1fd6; /* Some random(-ish) dark blue */
}
Code:
.left a {
/* ... */
}
Though this discussion has focused mainly on classes, they aren't always necessary. Selectors are mainly based on structure: ancestor-descendant relationships, mainly. A typical one is: Code:
a img {
border-style: none;
}
Hope that helps, Mike |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|