/    Sign up×
Community /Pin to ProfileBookmark

"padding-right" question

why would a “padding” property work on my page but not a “padding-right” property? If I specify the padding around a whole element, it works. But if I remove the “padding” specifier and just use “padding-right”, nothing happens. Not even if I set the padding-right to “7000px”.

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@mike444authorNov 26.2005 — I read up on css at http://www.createwebmagic.com/css101/lesson2/ but they don't delve into it deep enough.

Here's my page:

http://www.warlike.ms11.net/newsite.html

I would like to get the the left and right block elements even at the bottom and the right block element even on the right with the banner. The tutorial says specifying padding-right, padding-bottom, etc is the way to do it but it appears to be easier said than done.

Except for the google ads, I'm trying to redo my site without tables.
Copy linkTweet thisAlerts:
@mike444authorNov 27.2005 — I think I fixed my previous positioning problems (at least as far as I can see). However, as I added the final element to the bottom of my page (the "footer" with copyright info),

I encountered a problem of centering and it also does not display at the very bottom of the page in IE. Instead, it is closer to the top of the page but behind the other block elements. In IE, you can just see it protruding on the right, around the same height as the google search box. In mozilla, it is where it should be, at the bottom of the page. But again, I've tried "margin-right, margin-left: auto" but it will not center.

If I can, I'd like to understand how I can center the amazon frame element too. I've tried a couple of things but the page is not responding. But mostly, I'm interested in solving the footer problem.

Hopefully, someone will be able to advise me on this as well as mention any display problems my browsers aren't showing. Thank you.

edit: the new page is still at the same address:

http://www.warlike.ms11.net/newsite.html

mike
Copy linkTweet thisAlerts:
@ray326Nov 27.2005 — Padding is not "around an element" it's "inside an element". I.e. it's between the border and the content. Margin is "around an element". I.e. it's between the border and the adjacent elements.
Copy linkTweet thisAlerts:
@mike444authorNov 27.2005 — Padding is not "around an element" it's "inside an element". I.e. it's between the border and the content. Margin is "around an element". I.e. it's between the border and the adjacent elements.[/QUOTE]

Yeah, that was probably misleading on my part. From the tutorial I knew the difference between padding and margin. I shouldn't have used the phrase "around an element". But basically, I understand what it is supposed to, in theory, control. I used "height" to adjust my border sizes and that seems fixed now.

Anyway, my problem now is the copyright info at the bottom of the page. I'm trying to get it to be composed of two centered lines but I'm not sure what tags to put it in to acheive this. In mozilla, it displays at the bottom but it's not centered. In IE, it displays way up on the page, peeking out partially from behind another block.

btw - I [I]do[/I] know the <center> tag could probably fix this but I don't want to use outdated code if I can help it.
Copy linkTweet thisAlerts:
@mike444authorNov 27.2005 — I just looked at my site in Opera. The blocks are are mostly slightliy off centered with each other.

I noticed that my friends' game site uses tables and it looks fine in opera. Is it worth it dropping tables or am I just making it impossible for my site to be displayed correctly in Opera and other browsers?
Copy linkTweet thisAlerts:
@mike444authorNov 27.2005 — Anyway I can get my borders [I]not[/I] to display in Opera?
Copy linkTweet thisAlerts:
@mike444authorNov 27.2005 — I think the problem is there is a slight difference in the way Opera reads margin-left. I can align the blocks in Opera now if I alter margin-left by 8px but, of course, it then is off by 8px in IE. Are borders not recommended with pure css? Or is there a way to make this work?
×

Success!

Help @mike444 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...