- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
How can I get a border around my paragraph text which is nested inside a div with a fixed height and width?
It works with the text-decoration: underline overline property but I want to give the border some more padding. Increasing the line-height doesn’t work.
This is the HTML
TOPAANBOD Ervaren model (750 jr.).
Staat graag in de picture! Fotoshoot?
And the CSS
#advert1text{
float: left;
width: 315px;
height: 94px;
margin-bottom: 22px;
background: url('../images/advertbg.jpg') no-repeat;
}
#advert1text p{
padding: 18px 0px 0px 10px;
line-height: 30px;
text-decoration: underline overline;
}
Thanks in advance.
Why don’t you give it a proper border?
#advert1text p { border: 1px solid #000; }
Already tried that but that places a border around the div and not the paragraph text.
It shouldn’t. It is probably only appearing that way because of the padding that you have applied to the paragraph.
I’ve removed the padding and I get the same result; a border around the entire div and not the paragraph.
It’s weird as removing the div results in a border that takes as much space as possible and does’t stick to the size of the paragraph.
Aaahhh yes. Add a margin to the paragraph.
Try this