You can try to give a Global CSS Reset, all browser has priorities to define a page’s CSS.
The order is:
CSS inline
Through the use of the attribute style
which I do not recommend:
<div style=”float:left”>
CSS on the page
Another thing I don’t recommend, and I don’t see the need. It’s when you tag style
within the TAG head
:
<style>
.publicidade {
width: 200px;
}
</style>
External CSS
This is the normal CSS, when we invoke inside the head
:
<link href=”home.css” type=”text/css” rel=”stylesheet”/>
CSS defined by browser
Yes, that exists and that’s what causes us problems.
When no CSS is found for an element (div
, p
, h1
, img
, etc.. ), the browser puts on its own, what will be the size of titles, paragraphs, the margin
between elements, the standard source, the padding
page, edges of the elements, etc...
This is where the CSS Global Reset comes in, which is a series of CSS properties assigned to all HTML elements, precisely to remove the CSS defined by browser, leaving the properties of all elements equal. Thus drastically reduces the difference between Firefox, Safari, Internet Explorer, Opera, etc.
There are several CSS Global Reset (usually people put something else on to make your project easier), but they all vary little.
I use this one:
{outline-color:invert;outline-style:none;outline-width:medium;}
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
pre,a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: normal;
font-style: inherit;
font-size: inherit;
font-family: inherit;
vertical-align: baseline;
}
:focus { outline: 0; }
body { line-height: 1; color: black; background: white; font-size:100.01%;}
ol, ul { list-style: none;}
table { border-collapse: separate; border-spacing: 0;}
caption, th, td { text-align: left; font-weight: normal;}
blockquote:before, blockquote:after,
q:before, q:after { content: "";}
blockquote, q { quotes: "" "";}
strong{ font-weight: bold; }
body,input,select,textarea { font-size: inherit; }
help us respond by posting your code
– Silvio Andorinha
You can give an example on http://jsfiddle.net?
– Sampson
It looks like a box model discrepancy. Does your HTML have a doctype at the top? Which?
– bfavaretto
@bfavaretto had forgotten the part about discrepancy heheh almost sleeping here. Well, in that case, I believe there’s no way to answer the discrepancy problem without further detail from Helton.
– Fabrício Matté
To using HTML5 <!DOCTYPE html>
– HeltonSS
@Heltonss, a minimal example that reproduces your problem will help you get better answers.
– korbes
You are wearing
* { box-sizing: border-box }
too?– Sampson
I’m not using to trying to see a way to demonstrate here the problem
– HeltonSS
Add
* { box-sizing: border-box }
; touvez this will help.– Sampson
Just as a test, include the CSS of Bootstrap and see what happens.
– J. Bruni
@Jonathansampson as incredible as it seems his answer seems to have solved the problem, hahaha despite that it destroyed the entire layout in percentage but the objects are keeping in place, put as an answer I will finish adjusting the layout again and make the due considerations, Thanks to the whole world.
– HeltonSS