If I add margin and padding for this class, it starts twitching like on second GIF.
If I remove margin and padding everything is good, but I need them for styling.
What causing this and how can I fix it?
1 GIF
.ant-layout.ant-layout-has-sider {
max-width: 1440px;
}
2 GIF
.ant-layout.ant-layout-has-sider {
max-width: 1440px;
margin: 0 auto;
padding: 32px 0 0 0;
}
Just needed to add hasSider prop for Antd Layout component
Related
If I add margin and padding for this class, it starts twitching like on first GIF.
If I remove margin and padding everything is good, but I need them for styling.
What causing this and how can I fix it?
1 GIF
.ant-layout.ant-layout-has-sider {
max-width: 1440px;
margin: 0 auto;
padding: 32px 0 0 0;
}
2 GIF
.ant-layout.ant-layout-has-sider {
max-width: 1440px;
}
In case it will help someone: add hasSider prop for Antd Layout component
When I check the following code in the Chrome devtools (device toolbar, responsive) and the window gets smaller than 1040px width, the ".wrapper" suddenly get's an increasing right margin until 60px.
I really can't understand why it get's this margin. Can anyone explain this behavior or push me in the right direction?
My HTML-/CSS-Code:
body {
background-color: grey;
padding: 0;
margin: 0;
}
.wrapper {
width: 1040px;
margin: 0 auto;
background-color: red;
}
header[role="banner"] {
background-color: #fff;
padding: 20px 0;
}
<header role="banner">
<div class="wrapper">
<h1>Headline</h1>
</div>
</header>
The line "margin: 0 auto;"
actually means no vertical margin and spread the horizontal margin "automatically": That means there will be an equal margin on the left and right of your "wrapper" to fill in for what goes beyond the 1040 px.
I am positive this is to do with the browser default style that is applied. Try using a normalize or css reset file with your code and see if the style is still applied.
As you can see on this link ( http://riksblog.com/Marnik/index.html ), for some reason the width of the body and website is as it should, but there's a strange, empty space next to my website which makes it wider than it should.
I'm using bootstrap so I'm not really able to use these tricks like media-queries in css for the desktop version.
your looking for the overflow css property try this:
body {
overflow-x: hidden;
}
to completely remove the problem get rid of the right padding on this class:
section.first .section-content {
padding: 150px 15px //remove left/right padding
}
The problem is this css:
section.first .section-content {
position: relative;
width: 100%;
padding: 150px 15px;
text-align: center;
}
which causes the .section-content div to be as wide as its parent plus 30px.
Possible solutions are to add a box-sizing property to the style
box-sizing: border-box;
or change the width so that it doesn't exceed its parent
width: calc(100% - 30px);
I have a container with a repeating image that i want to fill 100% of the available height. Some of the inner divs have their :after pseudo elements absolutely positioned so i can get the borders the way i need them. This is causing an issue with the repeating background of the main container.
Please visit this link and scroll to the end of the page -
http://www.mariage-graham-audrey.com/static.html
Can anyone suggest a possible solution for this ?
Just a workaround but try to add larger bottom padding to layout like this:
.layout {
...
padding-bottom: 180px;
}
Just saw your CSS and I think by adding this you would be able to get a full page background :
background: white url("/bootstrap/assets/images/pattern.png") 0 0;
width: 100%;
margin: 0 auto;
padding: 30px 0;
min-height: 100%;
Just edit the " width:100%; " thats all.
Please Replace your style for layout div with this. It will work
.layout{
background: white url("/bootstrap/assets/images/pattern.png") 0 0;
width: 100%; /* add 100% width*/
margin: 0 auto;
padding: 0 0 150px 0; /*change padding with this*/
min-height: 100%;
}
I have this website www.mydubaitrip.com and you can see that the booking panel is floating on the left side. What I want is to fix it at the edge of the booking panel. How can I achieve this?
I already put in an absolute position but it is not working.
Update:
Please note that I have a javascript function that automatically re-size the banner image width and height then automatically place the footer based on the new banner image height.
Remove margin and jist type
margin: 100px 0 0 0;
Get rid of the margin: 100px 0 0 56px; on .bookPanel.
Then, with the position still set to "relative", do top: 110px;
Remove left margin from .bookPanel, make it like this margin: 100px 0 0 0;
.bookPanel {
display: inline;
float: left;
margin: 0;
margin: 100px 0 0 0;
position: relative;
width: 264px;
z-index: 1;
}
If you want to adjust the top position you can reduce the top margin value which is now 100px