<div> CSS help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

Unknown

Established Member
Impact
3
I have a div inside a <td> whose width I want to be as long as the text inside it. I tried making the position: absolute, but then the text in the <tr><td> below it would overlap with the <div> text. Here is the css for the div:

.Info
{
font-size: 10px;
text-align: left;
border-bottom: solid 1px #888888;
text-indent: 10px;
}
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Can you post the HTML code?
 
0
Close
Code:
<table>
<tr>
<td>
        </td>
        </tr>
        <tr>
        <td colspan="2">
        <div class="Info">
This Div is giving me problems
</div>
</td>
</tr>
</table>

.Info
{
font-size: 10px;
text-align: left;
border-bottom: solid 1px #888888;
text-indent: 10px;
}
 
0
Close
why do you need the table at all? more details might help as i don't quite understand the issue and what you're trying to accomplish... don't you just need to take out the text-indent or something?... :blink:
 
0
Close
I took out some text to make it easier to read.

What i'm trying to accomplish is an underline of all the text inside this div. The text is small font/italicized and wont' take much space as opposed to the cell the div is in. The table cell will be about 500px wide due to other text inside of it. I want the info text to have an underline of only the text and not the whole span of the cell.

I put the indent on purpose, i want space in the beginning, but none at the end.
 
0
Close
couldn't you just use <u></u>?
 
0
Close
.... yeah, thanks for reminding me that exists :P

Gonna use span instead though, more options with that.

thanks for the help lol, i def over thought what i wanted to accomplish
 
0
Close
no problem. sometimes you just need to sit back and look at it again... or get fresh eyes on it. :blink:
 
0
Close
yea, use a span, and then text-decoration: underline.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back