Add Padding Around All Webpage Contents [closed] - html

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
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.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
I am working on a webpage with an embedded javascript web app and the styling on that has messed up the padding on my web page. I would like to add padding around all the contents of the page so they are not completely pressed against the edge but nothing I seem to be doing is working. First i tried encompassing all the contents in the body with a div and adding CSS padding to that div but nothing. Then I tried adding padding to the body in the CSS file but nothing. Finally I tried *{ padding: 10, 10, 10, 10 px; } but still nothing. Any idea on how to add padding around all the contents of a webpage?

Simple-
*{
padding:5% /* or whatever */
}
Note- this is far from ideal. Better to use a full reset and amend accordingly. Eric Meyer's is fairly easy to decipher
Your syntax is wrong too, its *{padding: 10px 10px 10px 10px;}, no commas
AMEND FOR APPARENT OP USE -
body{
padding: 10px;
}

10 is an invalid value for padding. You're probably looking for px or %. Also, adding padding to * will add padding to every single element on the page, not just around the "edge" of the page.
body{
padding: 10px;
}

Related

border-radius not working consistently in similar divs in chrome [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
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.
Improve this question
The website I'm working on has a div on the right showing code examples in the hero section of the homepage. We use a similar div on one of our landing pages (https://buttercms.com/l/ruby-blog-software/) but the bottom of the div doesnt have rounded borders.
I can't figure out why the landing page div doesnt have rounded borders but the homepage div does.
It only did it at certain breakpoints and only on one of my monitors.
The <pre> only showed up on the same breakpoints the border was wrong
The solution that worked for me was
body.landing_page .code-examples .code-container .code pre {
margin: 0;
border: none;
border-radius: 5px;
text-align: left;
min-height: 320px;
}
The original border radius was 0px

Thin line between horizontal <img> and <div> [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
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.
Improve this question
I have a thin white line between a black image and a div with a black background on a page with the body background set to white. I have tried setting border: 0 !importantamongst other things but I just can't get rid of it.
Is there anyway of removing this?
Naturally, try border: none; on both the div and the img. Also double check that it's not actually part of the image. It may also be a margin on the div. Finally, try stringing the div and img immediately next to each other with no whitespace.
<img><div>
instead of
<img>
<div>
Try to set the image to "display:block;" with CSS. If the Line is not in your image or in your DIV, it should fix the problem.
Try it:-
img{
vertical-align:middle;
}

Bootstrap Column - Position Relative and Z Index [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
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.
Improve this question
I have an element that has a fixed position to the bottom left corner of the browser window. I noticed that the text in footer layers above the fixed position element.
I traced this back to the Bootstrap style for columns that sets them to a relative position. If I remove or override that style, the layering appears as I desire. I don't, however, know why that style is there. I am concerned over unintended side-effects.
Why does Bootstrap use position: relative in their column class?
I'm also open to other ways of accomplishing my desired layering without changing core Bootstrap styles.
EDIT
When creating a minimal example, I found that the issue was not present. I then looked to my own CSS for the problem. I found that it was z-index: 0 on the element containing the fixed position element that was the culprit. Changing it to z-index: 1 fixed the problem.
Add a class to the element that you want to change then overwrite the Bootstrap styles with the new class.
It is difficult to guess without a code example, but something like:
<footer><p class="override-bootstrap">Some text</p></footer>
CSS
.override-bootstrap {
// here reset the styles
}
Make sure that the stylesheet for your new class is included after the bootstrap css.

How do I get rid of this space in my document [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 8 years ago.
Improve this question
enter code herehttp://jsfiddle.net/rLP5V/
I have my document listed above, for some reason, even when I set margins to 0 the margin between the header1 and nav bar still shows and leaves an unnessecary blank between the both of them. Please let me know how to get rid of it. P.S. The page I am creating is for a project
Elements like h1 and ul have usually their margin set by the browser's (user agent) own stylesheet unless explicitly overwritten :
h1 {
margin: 0;
height: 50px; // SAME HEIGHT AS PROFILE PHOTO
}
ul {
margin: 0;
}
See Fiddle: http://jsfiddle.net/bonatoc/jhU85/1/
Look for the last lines added to the CSS.
The h1 element has a margin defined by the browser. You will have to override this in your CSS.

Adjusting padding to fit [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 having a real hard time trying to figure out how to fix this css issue. I'm trying to fix what's in the 3rd table content that is the compose new pm message form so that it doens't have any space between the form and the outer content just like it is on the template that says Form with Alternative Style in the form heading. I can't fix the content class rule because that completely messes up the rest of the page and you can see that if you go back to one of the other two tabs.
Template: http://www.kansasoutlawwrestling.com/peach/forms.html
My Page JSfiddle: http://jsfiddle.net/MtzqR/
The parent element has left and right padding and the child divs are using negative margins to compensate (not ideal but it works). Applying the same negative margins seems to work:
.box .content2.no-padding {
margin: 0 -11px; /* Apply -11px margins to left and right sides */
}
Try and set the following:
.box .content2,
ul.block-list {
margin: 0;
}