Jump to content

successful overwrite?


Illasera

Recommended Posts

Hey all,Let`s assume am trying to overwrite with CSS the default (x)html link = <a> (anchor tag).now let`s say the CSS code look`s like this : (In own css file)#link_one{text-decoration:underline;color:#000000;padding-right:35px;margin-right:35px;text-align:right;direction:rtl;}(html file)html & head & body tags includedcss file includedin <body> tag :<a id ="link_one" href=test.html">test</a>end html tags and fileNow, The text-decoration, color, direction will be applied, but text-align, margin, padding won`t.I will have to create a <div style> in html code for it and define them (text-align, margin, padding) there.My questions are:1.)Why some tags use their own default behavior while ignroing my css overwrite?2.)How can i tell what i can/can`t overwrite.

Link to comment
Share on other sites

In general, CSS selectors all have specificity, which defines how "important" they are: http://www.w3.org/TR/CSS2/cascade.html#specificity. In most CSS implementations, this specificity can be overwritten by using the !important modifier after a property.However, in your case it's simply because the anchor element is inline, and therefore can't be aligned (as inline elements don't have a "block" to align them within). Margin and padding should still be applied, however.

Link to comment
Share on other sites

In general, CSS selectors all have specificity, which defines how "important" they are: http://www.w3.org/TR/CSS2/cascade.html#specificity. In most CSS implementations, this specificity can be overwritten by using the !important modifier after a property.However, in your case it's simply because the anchor element is inline, and therefore can't be aligned (as inline elements don't have a "block" to align them within). Margin and padding should still be applied, however.
Thank you :) I guess i need to read a bit...
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...