When I zoom out or zoom in the browser some of the web content messed up. How to fix this?
Here's the CSS of the home page (first link)
.footer-image{
position: relative;
width: 100%;
}
.homeheaderh1{
float: left;
font-weight: bold;
color: #d31716;
margin: -520px 0 0 100px;
/* display: initial; */
line-height: 1em;
}
.homeheaderh3{
font-weight: normal;
margin: -320px 0 0 100px;
position: absolute;
line-height: 1.20em;
}
.homeheaderbutton{
float: left;
margin: -220px 0 0 100px;
position: absolute;
}
.homeheaderp{
float: left;
margin: -60px 0 0 100px;
position: absolute;
font-weight: bold;
}
Here's the CSS of 2nd link
padding-top: 10px;
margin: -550px 0 0 500px;
color: #FFF;
position: absolute;
margin: -450px 0 0 400px;
color: #FFF;
line-height: 0.10em;
position: absolute;
font-weight: 300;
Here's the pages where the web contents are messed.
http://bit.ly/1KJjaOZ
http://bit.ly/1KCVhJv
When I view the source in the browser
view-source:http://homecredit.ph/testEnvironment/products-promos/standard-loan/
on line 168 it says
<div style="width: 115.80%;">
Usually I would avoid setting widths to greater than 100%, because then, it and all it's contents inherit that width, often resulting in the content not fitting on the screen/container.
As the CSS is inline, and not coming from a CSS style sheet, this could be trickier to fix. You need to find out
- Where that style is coming from, and it might also be useful to know
- Why is it there? (too often I 'fix' one thing, only to break 10 more. This is especially true of CMS themes) But nonetheless I would go with 100% width (or less, e.g. with margins also). If that breaks stuff temporarily, I would just work with it, fixing whatever gets broken, because otherwise you'll be layering fixes (most of which may be unnecessary), on top, all because of, e.g. one bad fix like the 115% width container.
As far as responsive CSS in general is concerned, look into 'media queries', and best practices, e.g. 'mobile first'.
Related
I've never had this problem before, but for some reason, my 'overflow: auto' tags are not working correctly. They show scrollbars, but I can't actually scroll the scrollbars. The scrollbar appears if a section is larger than the height of the container, as it should, but the actual scrolling capability is defunct. It's as if the scrollbar is simply frozen and won't move. I've searched across the internet for why this may be happening, and couldn't find an appropriate solution. I also tried removing the 'overflow: hidden' from my parent element, thinking that it may somehow be affecting the entire code, but removing that elicited no effect whatsoever. I've also double-checked that everything has a width and height, since I know that missing those can adversely affect an overflow. I also checked the positioning of each item. (And I also know it isn't just my mouse messing up because scrolling on other sites/pages is perfectly fine)
I'm frustrated and entirely at a loss at this point, so I'm hoping extra sets of eyes may spot something that I'm missing.
Here is my project: https://codepen.io/royalstandard/pen/RwMxrLB
Main container -
.ldmainprofile {
width: 1100px;
height: 1400px;
padding: 0px;
background-image: linear-gradient(80deg, rgba(163,135,135,1.0), rgba(163,135,163,1.0));
border-radius: 15px;
position: relative;
overflow: hidden;
z-index: -10;
}
The first "frozen" container -
.basics {
height: 300px;
width: 270px;
border: 20px solid rgba(92,65,92,0.6);
background-color: #CCC;
border-radius: 10px;
position: absolute;
margin: 20px;
}
.basics ttl {
display: block;
font-family: aclonica;
font-size: 22px;
height: 22px;
width: 250px;
text-align: center;
padding: 20px 10px 10px 10px;
border-bottom: 1px dotted #888;
color: rgba(92,65,92,0.8);
}
.basicscroll {
height: 247px;
width: 240px;
background-color: #FF7777;
padding: 0px 15px;
overflow: auto;
}
.basics cat {
display: block;
font-family: poppins;
font-size: 15px;
text-align: left;
margin: 10px 0px 10px 10px;
color: rgba(92,65,92,0.6);
letter-spacing: 1px;
text-decoration: underline rgba(92,65,92,0.3) 4px;
}
The sections being affected so far are ".basicscroll" (currently coded with peach color as I do to clearly see what I'm working on) and ".info2 trig" at the bottom.
I have a div containing some text with individual letters having a background/border effect as illustrated in the screenshot:
Both the parent div and the individual numbers have a line-height of 1. See CSS below:
.jobcount {
font-weight: 300;
line-height: 1 !important;
-webkit-text-size-adjust: none;
vertical-align: top;
margin: 0 0 25px 0;
overflow: hidden;
b {
line-height: 1;
padding: 3px 4px 2px 4px;
-webkit-text-size-adjust: none;
font-weight: normal;
display: inline-block;
margin-right: 2px;
border-radius: 2px;
background: #A4CD39;
position: relative;
color: #016699;
&:before {
opacity: 0.2;
border-top: 1px solid #016699;
position: absolute;
content: "";
top: 50%;
left: 0;
right: 0;
bottom: 0;
width: 100%;
margin: 0 auto;
}
}
}
On both mobile iOS and Android (less pronounced on Android, but still present) there is additional space below the numbers, causing the background to extend below where it is desired. For an example of how it should appear (and does on all 4 desktop browsers), see:
What am I missing on mobile browsers that is causing line height to differ?
Many bold fonts do have slightly different metrics than their non-bold counterparts. So one solution would be to find a font where the heights are identical for bold.
Or indeed, as David Millar mentioned in the comments, assign a height to the b element. If you do, make sure that you also give it display:inline-block or the height will be ignored.
On this LIVE DEMO you can see an icon, which is several times bigger on IE 11 than on any other normal browser (FF/Opera/Chrome)
Size must be 12 em as seen on code, but it differs quite a bit between browsers:
.titlePanel [class^="icon-"]:before,
.titlePanel[class*="icon-"]:before{
font-size: 12em;
left: 79%;
line-height: 100%;
margin: 0 0 0 50px;
position: absolute;
z-index: -5000; }
As explained on this one of the many bugs on our beloved IE, pseudo-selectors apply multiple CSS rules when sizing, if there are multiple selectors applied to a pseudo-selector:
https://connect.microsoft.com/IE/feedback/details/813398/ie-11-css-before-with-font-size-in-em-units-ignores-css-precedence-rules
To avoid this I have changed, as seen on here, to a single rule for pseudo-selectors contained on nav, and anothe single one for those contained on .titlePanel:
nav [class*="icon-"]:before,
nav [class*="iconH-"]:before {
float: right;
font-size: 2em;
line-height: 50%;
margin: -5px 7px 0 0;
position: relative;}
.titlePanel [class^="icon-"]:before{
font-size: 12em;
left: 79%;
line-height: 100%;
margin: 0 0 0 50px;
position: absolute;
z-index: -5000; }
I can't seem to find anything that quite matches my issue, here.
.nav.top .main .buttonsWrap .button {
display: inline-block;
position: relative;
line-height: 32px;
height: 33px;
padding: 0 27px 0 28px;
vertical-align: top;
}
That's my CSS. For some odd reason, the line-height isn't working. No matter what I set it to, it's just not doing anything and Chrome debug has it disabled. Any help is much appreciated!
I know this has been asked alot of times in the past but for the life of me I can't seem to get any of the other solutions to work.
What I'm trying to do is to get the footer (which is an image that repeats across the width of the page) to stick to the bottom of the browser when there isn't enough content to naturally push it to the bottom of the page and when there IS enough content to push it to the bottom it does just that. An example is the one at http://www.themaninblue.com/experiment/footerStickAlt/good_example_short.htm which does exactly what I want but I can't get to work either.
The code that I've currently got implemented makes the footer stick to a certain section of the page with text going under it. You can see it at sourcectrl.co.uk but its not much to look at. Heres the code for your viewing pleasure.
html, body {
font: 100% Arial, Helvetica, sans-serif;
height: 100%;
color: #597347;
margin: 0;
padding: 0;
background: #573909;
}
header {
display: block;
position: relative;
top: 0;
left: 0;
width: 100%;
height: 66px;
background: url(../images/FillerPage_01.gif) repeat-x left bottom;
}
section {
width: 940px;
margin: 0 auto;
font-size: 1.4em;
overflow: auto;
min-height: 100%;
height: auto !important;
height: 100%;
margin-bottom: 87px;
position: relative;
padding-bottom: 90px;
}
footer {
display:block;
position: absolute;
bottom: 0;
width: 100%;
height: 87px;
background: url(../images/FillerPage_08.gif) repeat-x left bottom;
}
Sorry if it seems messy! I'd just like to know if I'm heading in the right direction or theres something I'm just not getting? Oh yeah I'm trying to do all of this with the html 5 markup which is why there is no #footer and the like (could this be why none of the solutions work?).
If anyone could give me any help or guidance I'd be soooooo grateful.
I believe the code you are looking for is here:
http://www.themaninblue.com/writing/perspective/2005/08/29/
I implemented this just now on my site, and it's working great!
it's a while since you asked your question but hopefully this helps!
This is the source that helped me achieve such a layout :
http://www.jaydepro.com/blog/post/Frameless-page-header-and-footer-using-CSS.aspx
Put everything in the Main in a Wrapper and use the following code:
html, body, form
{
height: 100%;
}
#wrapper
{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -80px; (-80px will be different for you, usually the same as the footer but negative but mine is different)
}
#footer, .push
{
height: 60px; (This is just the height of MY footer, change this to whatever size your footer is)
}