mobile device only shows 80% of page's width - html

I uploaded a responsive site I did for a friend that does not render full width on the Index Page whether viewed on a smartphone or tablet.
The lady is doing me a favor as I try to get my name and work known. She has a business she'd like to see grow and we thought the Internet the place to start.
The odd thing is that site's other pages render just fine with proper width and height.
This leads me to believe the problem is with the "#media screen" queries.
I believed the CSS "width" and other properites and values in the full width, non-mobile page's code, would "cascade" down into the smaller mobile queries but added the properties "head," "html, body" and "footer" sections to see if that would improve the situation.
It did not.
The site can be viewed here: www.notaryonwheelsshaver.com
The CSS can be read here: http://www.notaryonwheelsshaver.com/css/nows.css
Any help would be greatly appreciated.

Your first media query (780px) has a typo in html,body -> height: 100%x; That may be interfering with the min-width attribute under it.
I don't know if that will fix it, but it's what I noticed.

I think the issue is in your CSS file:
html, body {
font-family: Tahoma, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 26px;
background-color: #FFF;
color: #555;
padding: 0;
margin: 0;
height: 100%;
/*width: 100%;*/
}
/*width: 100%;*/ is commented out which makes the browser skip the code try changing it to:
html, body {
font-family: Tahoma, Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 26px;
background-color: #FFF;
color: #555;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
EDIT: You have the width also commented in:
.wrapper {
/*min-width: 100%;*/
min-height: 100%;
}

Related

How to Set Website Content Fit to All types of PC's Resolutions using Css

I am exhausted by working around this all the hours . The problem i am having is the website fits absolutely perfect in my laptop (All the Contents are being displayed without me scrolling the page ). Works perfectly for few other pc's aswell when i upload the website in test server.
But it gets zoomed in and scroll gets enabled for few pc's , i.e all the contents are not being displayed in single shot with few pc's resolutions , I have to scroll to see the missing out content.
How can i resolve this ?
I have my Css file with html and body set to height,width: auto and few font sizes in rem's . Here's the Css part :
:root{
--project_bg_color1 : #D81F26;
--project_bg_color2 : #EEB51E;
--text_colours : white; /* Also used for container background color */
--btn_colours_1 : #D65421;
--btn_colours_2 : #EDB41E;
--bg_colors_elements : transparent; /* background transparent for buttons , containers , border elements etc... */
--container_border_color : #e5765b;
--black_text_color : #2D2D2D;
--big_font_sizes : 1.2rem; /* Used in Headers , Tables and stake pages */
--medium_font_sizes : 1rem; /* Used for contents */
--medium_font_sizes_2 : 0.8rem;
--font_family : Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif;
}
html {
-moz-text-size-adjust: none;
-webkit-text-size-adjust: none;
text-size-adjust: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-family: var(--font_family);
line-height: 1.5;
overflow: scroll;
overflow-x: hidden;
height: auto !important;
width: auto !important;
}
::-webkit-scrollbar {
width: 0; /* Remove scrollbar space */
background: var(--bg_colors_elements); /* Optional: just make scrollbar invisible */
}
/* Optional: show position indicator in red */
::-webkit-scrollbar-thumb {
background: var(--project_bg_color1);
}
body {
background: url("../media/shapes.png") , linear-gradient(-0.7turn,var(--project_bg_color1), var(--project_bg_color2)) no-repeat center center fixed;
margin: 0;
padding: 0;
height: auto !important;
width: auto !important;
}
main {
display: block;
}
Please help me fix this . I am aiming to set the content display should be fit for all types of PC's and resolutions.
Regards
to begin with, get rid of all fixed width sizes, then you can set breakpoints using #media (max-width: x) where x will be the width at which the breakpoint will occur
for example
the base width of the block is 600 pixels, but using a media query for devices with a width of 900px and below, we change the class parameters
body {
background-color: #333;
}
.nope {
width: 600px;
height: 50%;
position: absolute;
background-color: aliceblue;
left: 20%;
}
#media (max-width: 900px) {
.nope {
width: 400px;
height: 30%;
position: absolute;
background-color: red;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class='nope'>
</div>
</body>
</html>

HTML/CSS - Aligning text, Scrollbar Appearing

I'm new to coding and I'm in the process of creating a website for my father to help build experience and a portfolio.
I'm using unsemantic & normalize.
The problems I am having are as follows;
1) I can't seem to align the bottom of the words "Michael Gilsenan" with the text in my nav bar. I have tried using the line-height property but it's behaving inconsistently and moving in all sorts of strange ways.
2) I'm trying to create a line under the header either by using the <hr> tag or by using the border-bottom property. Both of which eventually create a scroll bar on the <div> which houses my <nav> element.
I have been trying to find a solution for a good 4 hours and have done lots of reading. I apologise if I'm missing something obvious, I'm very tired now!
Thanks very much.
<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
<link rel="stylesheet" type="text/css" href="../external/css/normalize.css">
<link rel="stylesheet" type="text/css" href="../external/css/unsemantic-grid-responsive-tablet.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:700|Open+Sans:400,600" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body class="grid-container">
<header class="grid-parent">
<div class="grid-50">
Michael Gilsenan
</div>
<div class="grid-50">
<ul>
<li>About</li>
<li>Bio</li>
<li>Portfolio</li>
<li>Blog</li>
<li>Contact</li>
</ul>
</div>
</header> <!-- end of header-->
</body>
* {
margin: 0;
text-decoration: none;
}
hr {
border-style: solid;
border-color: #cacaca;
position: relative;
top: -40px;
}
/* header styles */
header {
font-family: 'Open Sans', sans-serif;
margin-top: 80px;
overflow: auto;
border-bottom: solid #cacaca 1px;
}
header a {
color: #332e2d;
}
.headertext {
font-family: 'Montserrat', sans-serif;
font-size: 300%;
letter-spacing: -0.01em;
line-height:
}
ul li {
display: inline;
}
ul {
word-spacing: 0.5em;
text-align: right;
}
On the ul
line-height: 55px; /* match the height of the headertext. */
On the header
overflow-y: hidden;
https://jsfiddle.net/wazz/ad6g2woq/63/
The trick was to find out what was causing the scrollbar. I selected the ul and went through the options and for scroll a 2nd scrollbar was added, so I new it wasn't that. Eventually I found that the scrollbar was on added on the header.
P.S. You should use a header tag <h1> for the headertext instead of making the text bigger (300%). Search engines look for header tags to understand the page (SEO). You can adjust the size of header tags in your css if it's too big or small, and still use the tag.
The scrollbar is appearing because you have the overflow property set to auto in the style declaration for the header element:
header {
font-family: 'Open Sans', sans-serif;
margin-top: 80px;
overflow: auto; <-- change or remove this
border-bottom: solid #cacaca 1px;
}
Auto gives the browser control over what to do when the contents of a container do not fit within the dimensions of the container and will often add scrollbars where you don't intend them. Removing the overflow property or setting it to none will eliminate the scrollbar.
I am not familiar with the unsemantic stylesheet that you are using but it appears to apply a float-based layout. This makes alignment of items within a container very difficult. As an alternative, I would suggest looking into flexbox. There are a few good tutorials out there. I have used all of these and can vouch for their quality:
What the Flexbox by Wes Bos - https://flexbox.io/
A Complete Guide to Flexbox - https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Flexbox Froggy - https://flexboxfroggy.com/
To achieve the layout I think you are aiming for with flexbox requires the following:
Remove the unsemantic grid classes from your HTML
Replace your CSS with the following
* {
margin: 0;
text-decoration: none;
}
/* hr {
border-style: solid;
border-color: #cacaca;
position: relative;
top: -40px;
} */
/* header styles */
header {
display: flex;
align-items: flex-end;
height: 80px;
font-family: 'Open Sans', sans-serif;
/* overflow: auto; */
/* the overflow property is setting your scrollbar. If you don't want the scrollbar, set to none : */
/* border-bottom: solid #cacaca 1px; */
/* Here, your properties are in the wrong order.
it should be:
1. border size
2. border type/style
3. border color.
Like this: */
border-bottom: 1px solid #cacaca;
}
header a {
color: #332e2d;
}
.header-text {
font-family: 'Montserrat', sans-serif;
font-size: 3.5rem;
letter-spacing: -0.01em;
/* line-height: */
/* When you leave in style properties with no value, this will often break your stylesheet. I've commented this out. */
}
header nav {
padding: 10px;
display: flex;
}
header nav ul li {
display: inline;
align-items: flex-end;
margin: 0 20px;
}
I added in some comments about a few other things I noticed in your CSS. To see a working sample, you can check out this pen:
https://codepen.io/danyadsmith/pen/mKjyKQ
Normally, I would attempt to answer the question by telling you what you could do to achieve the result you want with the technologies you are using, but in this case I think the grid system you selected is causing your frustration. Flexbox is gaining adoption in modern browsers and can safely be used in projects that don't need to support legacy browsers. For more information on that, check the flexbox section on Can I Use:
https://caniuse.com/#feat=flexbox
Hope this helps. Good luck!

Edit css file in swift/obj c without using javascript

I want to change the font/font-color/font-size of an html page. I have converted the css file to a string using String(contentsOfFile). Can I use regEx or something similar to edit the css data. Here is a sample of the css file
.calibre {
color: #000;
display: block;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 1em;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
text-align: justify
}
I have also tried converting this string(of Css file) to a Dictionary using ESCssParser. However, when I convert that dictionary(after changing the font size) to a string, the formatting is different. An example of a difference is that #idSelector would become "#idSelector". I am in the assumption that these changes will affect the css file. Am I wrong?
Is there any other approach I can take to edit the Css file?
Thanks!
It would be better if you changed a class in your html rather than try to change lots of entries in your css.
For example if you laid out your html like this:
<body>
<div id="wrapper" class="med">
<p class="calibre">Lorem Ipsum</p>
<!--rest of html-->
</div>
</body>
You could change the class in the #wrapperelement in your backend code and then use css to determine the style for the page, like this:
.calibre {
color: #000;
display: block;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 1em;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0;
text-align: justify
}
#wrapper.small .calibre{
font-size: 0.8em;
}
#wrapper.large .calibre{
font-size: 1.4em;
}
In the above example there is no specific class for med, so the default will be used (1em). If you were to make the wrapper have the class small or large instead of med, calibre would still have all the same properties except the font-size would change to 0.8em in the case of small and 1.4em in the case of large.
Here's an example with jquery taking the place of your backend code.

Background image will not render when hosted

I have built a landing page for an external client all is working fine, I have a background image which fits the hole screen, I modified the existing body tag within the bootstrap.css class as follows
body {
margin: 0;
background-image: url('/Content/Images/Danone-Background-New.png');
background-size: 1440px 800px;
background-repeat: no-repeat;
background-size: cover;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
z-index: 9999;
}
Again this works perfectly when running locally, I then publish this site to the hosting environment, and when I navigate to the site all the content is displayed minus the background image, so I first assumed I have the wrong path so I checked the body style using firebug and this is what I see
body {
background-color: #fff;
color: #333;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
line-height: 1.42857;
}
So for first glance I assumed "Oh that's strange it hasn't copied over my body styles!" so I repeat the process again and low and behold the body style remains as above, So i login to the server navigate through the files to the bootstrap.css find the body tag and again it looks as I expected
body {
margin: 0;
background-image: url('/Content/Images/Danone-Background-New.png');
background-size: 1440px 800px;
background-repeat: no-repeat;
background-size: cover;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.428571429;
color: #333333;
background-color: #ffffff;
z-index: 9999;
}
Yet the image does not render.
What is wrong with this? I have tried ctrl f5, looked in the development tool bar checked for any 404 erros nothing displayed ? I'm baffled?!
Link to check www.danoneultimate.com.au
In the <head> section of your website, you load a different stylesheet.
<link href="/Content/css?v=WY2Ybti5pBJYm0QfqiFBL2b5U_cKoeAWQC9DALv4mnw1" rel="stylesheet">
Change it so that it loads bootstrap.css:
<link href="/Content/bootstrap.css" rel="stylesheet">
You have edited bootstrap.css but you're loading bootstrap.min.css.
Your code works just fine :)

Simple CSS making trouble with IE 9

I have this CSS code:
html {
overflow-y: scroll;
}
body {
background-color: #e4e4e4;
font-size: 12px;
font-family: Verdana, 'Lucida Grande', Arial, Sans-Serif;
line-height: 1.6;
color: #555;
}
#wrapper {
width:950px;
position: relative;
margin: 20px auto;
background-color: #fff;
border: 1px solid #333;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
In Chrome it works perfectly, the wrapper is in the middle of any screen resolution and has curve border.
But very big trouble when it comes to IE9, the wrapper sticks to the left, the border doesn't show and other stuff.
See this post regarding rounded corners and IE 9 - IE9 border-radius
PS - Went to go troubleshoot this in IE9 on my VM and jsfiddle doesn't work in IE9 lol.
Think you need this
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
paste it between the <head></head> tags
Did you specify a correct doctype? This is just guesswork since you didn't share any HTML code.