What causes an element to not respond to margin/padding? [closed] - html

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Let's say I've got two elements, as pictured below, an img and a .date element. I've put a padding-top on the .date element, but it's just padding "inside" the img rather than being pushed off it. What would cause this? Is it the position of the img?

Is the element set to display:block? Inline elements (span, a, i, strong etc) will not respond to margin or padding.

Related

background-color of div does not appear in the image [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have used a p tag inside a div tag:
div{background-color:#3B3B3B;}
p{float:left;}
The background-color of div does not appear in the image:
How to solve this?
Using float on a child will cause the parent to collapse. There are many alternative solutions, see How do you keep parents of floated elements from collapsing?

Alternative to ul Li {display:inline} [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have a set of social media sprites aligned in a row, centered in a container with display:inline but I just realized they don't display at all in Firefox. What's the best alternative?
Inline elements don't have height. I assume that you're using sprites as CSS backgrounds, so you'll need to use inline-block and set explicit height and width.

Minimum height by css in html [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm creating web site layout.
This is label3 css :
background-color:#c4efd5;
min-height:368px;
height:100%;
I want the label3(<div>) re-size to 450px when I insert image height=450px and when there's no data in the box, the minimum height of label3 will be 368px. I used min-height but it didn't work.
Any answer will be appreciate. Thanks you.
Remove height: 100% it is overwriting your min-height
What element is this being applied to? Height will have no effect on inline elements such as spans etc. Either apply it to a block level element or set display: block on the selector

How to make HTML footer div stick to the bottom of the page [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm writing my home page in and the footer is shown on top of the main section.
I tried adding position:relative and position:absolute;bottom:0; but it did not work.
remove height from CSS style in this classes : .login and .homeArticle that way it will always fit at the bottom.

Why doesn't max-width take effect? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
See this: http://jsfiddle.net/xA8rm/
<div style="max-width:10px; oveflow:hidden;">
adwadddddddddddddddddddddddddddddd
</div>
I expected the div to be 10px in width and the characters that don't fit to be hidden.
Why isn't that happening?
<div style="max-width:10px; overflow-x:hidden;">
adwadddddddddddddddddddddddddddddd
</div>
First, you've misspelled overflow.
Second, max-width won't work on an hbox element (because they are display:inline and you can't set widths and heights on inline elements), so I changed it to a div. (You could also use an hbox and set it to display:block instead if you want to.)
Fiddle
Change oveflow: hidden to overflow: hidden (You're missing the R):
http://jsfiddle.net/NYxyc/
You're missing a r:
oveflow:hidden
should be:
overflow:hidden