Hi, I have the following problem I hope someone can help me
I have the CSS file

#one
{
border-style: solid;
border-width: 5px
}
#two
{
border-style: solid;
border-width: thick
}
#three
{
border-style: solid;
border-width: thin
}
#four
{
border-style: solid;
border-width: medium
}

and the HTML file

<table>
<tr>
<td id='one'><div id='uno'>border-width: 5px</div></td>
<td id='two'><div id='dos'>border-width: thick</div></td>
<td id='three'><div id='tres'>border-width: thin</div></td>
<td id='four'><div id='cuatro'>border-width: medium</div></td>
</tr>
</table>

As you can see every div has a different border width that is from the CSS file, I want to know what is "border-width: thick" in pixels, cm or some number not in words. I read the explanation I found in the WEB:
thin - Defines a thin border
medium/Default - Defines a medium border
thick - Defines a thick border
Sometimes I need to situated floating objects according to its border so I need to know what is a thin/thick/medium border in numbers.

Recommended Answers

All 3 Replies

Use the getStyles function to get the CSS property of an element. You would probably get the width of the element in pixels but that should work fine for you.

I'm using getStyles, but if I request the 'border-width' property of the element, I'm receiving 'thick', but I want to know what is 'thick' in pixel or cm or some value I can use, 'thick' doesn't help me to situated floating objects:

border-style: solid;
border-width: thick

Thanks

These are browser-dependent.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.