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 10 2020, 08:10 AM
Post
#2
|
Advanced Member Group: Members Posts: 109 Joined: 7-May 20 Member No.: 27,330 |
You said i should fix the image and the errors. The image thing i understand . the part which you said that i should fix the errors also... that's the part which i don't understand . i also put it in that link which you suggested but didn't understand their explanation.
This post has been edited by deb1: May 10 2020, 08:12 AM |
pandy |
May 10 2020, 11:02 AM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
But I told you about the three errors above. That you shouldn't use CENTER, that you can't have spaces in URLs and that images must have an alt attribute.
The CENTER tags - just delete them or replace them with DIV. The alt attributes, well, add them. There's a bit about that here. https://htmlhelp.com/reference/html40/special/img.html Spaces in URLs, I don't think I can say it differently than I did above. The validator complains about a few things more, but you can leave that for now. |
deb1 |
May 10 2020, 11:33 AM
Post
#4
|
Advanced Member Group: Members Posts: 109 Joined: 7-May 20 Member No.: 27,330 |
Can you please be specific which url you are referring to?
|
Lo-Fi Version | Time is now: 25th April 2024 - 03:57 PM |