css img underline
- Started
- Last post
- 9 Responses
- ldww0
whyt are you underlining your links with a border? if you use text-decoration: underline (which is default) then you would not have this problem as an image which is alone in an a can not be underlined.
i also like to always put
img { border: 0px; }
in my css to prevent any unwanted borders.
- ldww0
just so you know... if you give a ul a class you do not have to give every li a class too, they can be refered to by:
.classname li { blah blah }
in your css
- jakeyj0
it also helps if you use comments in your code to show the beginning and ending of sections
- jakeyj0
don't ever use inline styles. the point of css is to separate content from style.
organize things by divs
keep your code modular for easy debugging
use as little ids and classes as possible, use your stylesheet to get specific
- jaylarson0
"do yourself a favor and keep your code organized."
jakeyj,
what do you mean? this is another category of css that I am wanting to learn: what goes first, 'html re-formatting', divs, classes, and other stuff.i guess the experienced designer knows when to have inline css code, external sheets, and element-specific code. does this sound right?
thanks,
j
- jakeyj0
you're on the right track with getting into css
do yourself a favor and keep your code organized.
- jaylarson0
thanks again no comply. i used the style in and it worked.
my behavior is further reinforced to keep returning. thanks nt.
~jay
- jaylarson0
thanks nocomply. i'll give it a whirl.
- nocomply0
I believe what's happening is that your image is inheriting your default a:link, a:visited, and a:hover styles at the top of your stylesheet.
try maybe getting more specific with your class name...
like:
a:link.product-image { ...
or give the href element that the image is enclosed in a style with a border-bottom of zero.
something along those lines. the problem is in your link styles, not the image style.
- jaylarson
Dear NT Community,
I am having a helluva time getting rid of the line under the first product image in this page:
http://laserpointer.net/test.htm…The image is set up with CLASS instead of being inside of a DIV. The other images have links, but since they are in DIVS, they have their links controlled by: div#product01-image a
{border: none;} and DO NOT show on the page.Any ideas? Please help as I have tried Img and the other usual suspects (google)...
thanks in advance,
jay