Padding problem |
Padding problem |
msucimaster |
May 5 2020, 12:56 PM
Post
#1
|
Newbie Group: Members Posts: 11 Joined: 29-April 20 Member No.: 27,307 |
Thanks for solving my last problem. I have a new issue that puzzles me.
Inside a div I want to have a colored bar over the full width. Inside this bar I have some text. That text should be to the left with some margin. It is that margin that gives me a problem. I try to assign it with padding-left. It works for the text. Unfortunately a side effect is that bar grows with the size of the padding and now goes over the boundary of the enclosing div. What am I doing wrong? The code I have is: <div class="subBar">My Text</div> div.subBar { width: 100%; height: 28px; margin-top: 20px; font-size: 20px; text-align: left; padding-left:120px; background: #ee7; } |
deb1 |
May 8 2020, 10:00 AM
Post
#2
|
Advanced Member Group: Members Posts: 109 Joined: 7-May 20 Member No.: 27,330 |
So tell me if I am correct or wrong.
With th first example your basically saying the space between the border of the yellow box and the content in this case it's "test"..... am I correct? |
Lo-Fi Version | Time is now: 25th April 2024 - 03:32 AM |