Web Hosting Talk







View Full Version : [CSS] Line Height


JustinSmall
04-30-2008, 12:58 PM
Hello everyone, I set a line height :) Looks good between the lines... however its putting a space above the first line aswell...

I don't want this to happen, ne ideas?

stripeyteapot
04-30-2008, 01:06 PM
You could use a pseudo class but you may run into problems (http://www.satzansatz.de/cssd/pseudocss.html), if that fails try offsetting it with a negative/subtracted top-margin value.

JustinSmall
04-30-2008, 02:08 PM
I fixed it with margins!

Another question though, i have an image thats a background, but part of the image is a button, how can I make that part of the div link?

Jay August
04-30-2008, 02:11 PM
with a transparant image you overlay over the background. you could then link the transparant image so it looks like a real button.

JustinSmall
04-30-2008, 02:31 PM
example plz :)

Jay August
04-30-2008, 04:13 PM
<div id="has_background">

<a href="#"><img src="img.gif" alt="" /></a>

</div>


in your CSS:

#has_background {
position: relative;
}
#has_background a {
display: block;
width: 100px;
height: 100px;
position: absolute;
top: ??px;
left: ??px;
}

This needs more specific editing ofcourse, but at least its a basic piece of code that works.=

JustinSmall
04-30-2008, 04:21 PM
I get this jist of this, this should be helpful for the future :)

stripeyteapot
05-01-2008, 11:31 AM
A better method in my opinion would be to split the button from the background and export them seperately from source. I really don't like using extra code when it's unnecessary. But obviously, this is a preference!

killapix
05-01-2008, 11:40 AM
you could of course put the image inline and add a map area for the button portion of the image.?

Paul-M
05-02-2008, 03:52 PM
You could, but that wouldn't validate, and if it did, its not clean coding practice.

I'd say that separating the button part from image part into two images is best, but you could use a transparent overlay.

killapix
05-02-2008, 06:33 PM
You could, but that wouldn't validate, and if it did, its not clean coding practice.

I'd say that separating the button part from image part into two images is best, but you could use a transparent overlay.

I disagree with that.!
indeed client-side maps can be validated if used correctly.
How do you define 'clean coding practice' in reference to area maps.?(They should not be used.?)
My suggestion was intially was to try and solve the OP's original query on how he could achieve a result. Along with the other posters suggestions I feel that it would have been a valid one for his needs.