Hello & Thanks ,
In my code below , why is it the Html code
that the <div class="middle"> is specified BEFORE the
<aside class="left-sidebar"> and the <aside class="right-sidebar"> ?
Thanks..Vern
OOPS! Forgot code , see next Reply .
Hello & Thanks ,
In my code below , why is it the Html code
that the <div class="middle"> is specified BEFORE the
<aside class="left-sidebar"> and the <aside class="right-sidebar"> ?
Thanks..Vern
OOPS! Forgot code , see next Reply .
Oops , forgot the code:
<!DOCTYPE html>
<!-- http://csslayoutgenerator.com/
file:///C:/NotePad++/~~~Scratch-efile:///C:/NotePad++/~~~Scratch-etc/~Notepad_vmProjects/index_html5_liq_lcr_s2_m1000_hh75_fh50_eh_2.html -->
<html>
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style_html5_liq_lcr_s2_m1000_hh75_fh50_eh_2.css" rel="stylesheet">
<style>
/* Eric Meyer's CSS Reset */
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, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* End of Eric Meyer's CSS Reset */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
display: block;
}
body {
font: 12px/18px Arial, sans-serif;
}
/* Begin of styles for the demo (you can remove them) */
a.expand {
width: 90px;
display: block;
margin: 10px 0 0;
}
a.expand:hover {
height: 500px;
}
/* End of of styles for the demo */
.wrapper {
min-width: 1000px;
max-width: 1000px;
margin: 0 auto;
}
/* Header
-----------------------------------------------------------------------------*/
.header {
height: 75px;
background: #FFE680;
}
/* Middle
-----------------------------------------------------------------------------*/
.middle {
border-left: 250px solid #B5E3FF;
border-right: 250px solid #FFACAA;
position: relative;
}
.middle:after {
display: table;
clear: both;
content: '';
}
.container {
width: 100%;
float: left;
overflow: hidden;
margin-right: -100%;
}
.content {
padding: 0 20px;
}
/* Left Sidebar
-----------------------------------------------------------------------------*/
.left-sidebar {
float: left;
width: 250px;
position: relative;
background: #B5E3FF;
left: -250px;
}
/* Right Sidebar
-----------------------------------------------------------------------------*/
.right-sidebar {
float: right;
margin-right: -250px;
width: 250px;
position: relative;
background: #FFACAA;
}
/* Footer
-----------------------------------------------------------------------------*/
.footer {
height: 50px;
background: #BFF08E;
}
</style>
</head>
<body>
<div class="wrapper">
<header class="header">
<strong>Header:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tortor. Praesent dictum, libero ut tempus dictum, neque eros elementum mauris, quis mollis arcu velit ac diam. Etiam neque. Quisque nec turpis. Aliquam arcu nulla, dictum et, lacinia a, mollis in, ante. Sed eu felis in elit tempor venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut ultricies porttitor purus. Proin non tellus at ligula fringilla tristique. Fusce vehicula quam. Curabitur vel tortor vitae pede imperdiet ultrices. Sed tortor.
</header><!-- .header-->
<div class="middle">
<div class="container">
<main class="content">
<strong>Content:</strong> Sed placerat accumsan ligula. Aliquam felis magna, congue quis, tempus eu, aliquam vitae, ante. Cras neque justo, ultrices at, rhoncus a, facilisis eget, nisl. Quisque vitae pede. Nam et augue. Sed a elit. Ut vel massa. Suspendisse nibh pede, ultrices vitae, ultrices nec, mollis non, nibh. In sit amet pede quis leo vulputate hendrerit. Cras laoreet leo et justo auctor condimentum. Integer id enim. Suspendisse egestas, dui ac egestas mollis, libero orci hendrerit lacus, et malesuada lorem neque ac libero. Morbi tempor pulvinar pede. Donec vel elit.
<a href="#" class="expand">Expand column</a> </main><!-- .content -->
</div><!-- .container-->
<aside class="left-sidebar">
<strong>Left Sidebar:</strong> Integer velit. Vestibulum nisi nunc, accumsan ut, vehicula sit amet, porta a, mi. Nam nisl tellus, placerat eget, posuere eget, egestas eget, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In elementum urna a eros. Integer iaculis. Maecenas vel elit.
<a href="#" class="expand">Expand column</a> </aside><!-- .left-sidebar -->
<aside class="right-sidebar">
<strong>Right Sidebar:</strong> Integer velit. Vestibulum nisi nunc, accumsan ut, vehicula sit amet, porta a, mi. Nam nisl tellus, placerat eget, posuere eget, egestas eget, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In elementum urna a eros. Integer iaculis. Maecenas vel elit.
<a href="#" class="expand">Expand column</a> </aside><!-- .right-sidebar -->
</div><!-- .middle-->
<footer class="footer">
<strong>Footer:</strong> Mus elit Morbi mus enim lacus at quis Nam eget morbi. Et semper urna urna non at cursus dolor vestibulum neque enim. Tellus interdum at laoreet laoreet lacinia lacinia sed Quisque justo quis. Hendrerit scelerisque lorem elit orci tempor tincidunt enim Phasellus dignissim tincidunt. Nunc vel et Sed nisl Vestibulum odio montes Aliquam volutpat pellentesque. Ut pede sagittis et quis nunc gravida porttitor ligula.
</footer><!-- .footer -->
</div><!-- .wrapper -->
</body>
</html>`
Thanks..vm
The order of precedence within the cascade for CSS/stylesheet rules does not depend on the order in which those rules appear within your stylesheet. Search on "css precedence" and you'll find how this works.
Sorry , guess i wasnt clear:
I am talking about the sequence of html5 code , not the css .
I would expect the html order(sequence) to be :
<aside class="left-sidebar">
<div class="middle">
<aside class="right-sidebar">
but it isnt, its :
<div class="middle">
<aside class="left-sidebar">
<aside class="right-sidebar">
Can someone explain why ?
I just added some <h3> code to hightlight the Outline: then handed it to : https://gsnedders.html5.org/outliner/
to Outline it for me ,
Which shows :
<div class="middle">
<aside class="left-sidebar">
<aside class="right-sidebar">
But magically , the browser displays :
<aside class="left-sidebar">
<div class="middle">
<aside class="right-sidebar">
<!DOCTYPE html>
<!-- http://csslayoutgenerator.com/
file:///C:/NotePad++/~~~Scratch-efile:///C:/NotePad++/~~~Scratch-etc/~Notepad_vmProjects/index_html5_liq_lcr_s2_m1000_hh75_fh50_eh_2.html -->
<html>
<head>
<meta charset="utf-8" />
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style_html5_liq_lcr_s2_m1000_hh75_fh50_eh_2.css" rel="stylesheet">
<style>
/* Eric Meyer's CSS Reset */
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, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* End of Eric Meyer's CSS Reset */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
display: block;
}
body {
font: 12px/18px Arial, sans-serif;
}
/* Begin of styles for the demo (you can remove them) */
a.expand {
width: 90px;
display: block;
margin: 10px 0 0;
}
a.expand:hover {
height: 500px;
}
/* End of of styles for the demo */
.wrapper {
min-width: 1000px;
max-width: 1000px;
margin: 0 auto;
}
/* Header
-----------------------------------------------------------------------------*/
.header {
height: 75px;
background: #FFE680;
}
/* Middle
-----------------------------------------------------------------------------*/
.middle {
border-left: 250px solid #B5E3FF;
border-right: 250px solid #FFACAA;
position: relative;
}
.middle:after {
display: table;
clear: both;
content: '';
}
.container {
width: 100%;
float: left;
overflow: hidden;
margin-right: -100%;
}
.content {
padding: 0 20px;
}
/* Left Sidebar
-----------------------------------------------------------------------------*/
.left-sidebar {
float: left;
width: 250px;
position: relative;
background: #B5E3FF;
left: -250px;
}
/* Right Sidebar
-----------------------------------------------------------------------------*/
.right-sidebar {
float: right;
margin-right: -250px;
width: 250px;
position: relative;
background: #FFACAA;
}
/* Footer
-----------------------------------------------------------------------------*/
.footer {
height: 50px;
background: #BFF08E;
}
</style>
</head>
<body>
<div class="wrapper">
<header class="header">
<strong>Header:</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras tortor. Praesent dictum, libero ut tempus dictum, neque eros elementum mauris, quis mollis arcu velit ac diam. Etiam neque. Quisque nec turpis. Aliquam arcu nulla, dictum et, lacinia a, mollis in, ante. Sed eu felis in elit tempor venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut ultricies porttitor purus. Proin non tellus at ligula fringilla tristique. Fusce vehicula quam. Curabitur vel tortor vitae pede imperdiet ultrices. Sed tortor.
</header><!-- .header-->
<div class="middle">
<div class="container">
<main class="content">
<h3>middle.container<h3>
<strong>Content:</strong> Sed placerat accumsan ligula. Aliquam felis magna, congue quis, tempus eu, aliquam vitae, ante. Cras neque justo, ultrices at, rhoncus a, facilisis eget, nisl. Quisque vitae pede. Nam et augue. Sed a elit. Ut vel massa. Suspendisse nibh pede, ultrices vitae, ultrices nec, mollis non, nibh. In sit amet pede quis leo vulputate hendrerit. Cras laoreet leo et justo auctor condimentum. Integer id enim. Suspendisse egestas, dui ac egestas mollis, libero orci hendrerit lacus, et malesuada lorem neque ac libero. Morbi tempor pulvinar pede. Donec vel elit.
<a href="#" class="expand">Expand column</a> </main><!-- .content -->
</div><!-- .container-->
<aside class="left-sidebar">
<h3>Left Sidebar<h3>
<strong>Left Sidebar:</strong> Integer velit. Vestibulum nisi nunc, accumsan ut, vehicula sit amet, porta a, mi. Nam nisl tellus, placerat eget, posuere eget, egestas eget, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In elementum urna a eros. Integer iaculis. Maecenas vel elit.
<a href="#" class="expand">Expand column</a> </aside><!-- .left-sidebar -->
<aside class="right-sidebar">
<h3>right-Sidebar<h3>
<strong>Right Sidebar:</strong> Integer velit. Vestibulum nisi nunc, accumsan ut, vehicula sit amet, porta a, mi. Nam nisl tellus, placerat eget, posuere eget, egestas eget, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In elementum urna a eros. Integer iaculis. Maecenas vel elit.
<a href="#" class="expand">Expand column</a> </aside><!-- .right-sidebar -->
</div><!-- .middle-->
<footer class="footer">
<strong>Footer:</strong> Mus elit Morbi mus enim lacus at quis Nam eget morbi. Et semper urna urna non at cursus dolor vestibulum neque enim. Tellus interdum at laoreet laoreet lacinia lacinia sed Quisque justo quis. Hendrerit scelerisque lorem elit orci tempor tincidunt enim Phasellus dignissim tincidunt. Nunc vel et Sed nisl Vestibulum odio montes Aliquam volutpat pellentesque. Ut pede sagittis et quis nunc gravida porttitor ligula.
</footer><!-- .footer -->
</div><!-- .wrapper -->
</body>
</html>
Thanks..Vern
You can position elements with CSS wherever you want. The (html) source order of your elements does not has to be the same order visually. In your case the CSS float
, left
and margin
properties positioned the main content and sidebars where you see them on the screen.
It's usually a good thing to have the main content div at the top in the source, because you want to make sure that search engine bots will scan it properly.
gentlemedia has the key
the sidebars are less important than the main content,
this code layout ensures::
that bots index the content in the desired order, and
display it in the desired layout
on a slow cell data plan, the important content displays before unimportant sidebars even download
== on-page optimising
please put all css in the external css file, shrink page size download css once
== on-page optimising
First oops I see is use of a div as a major section container. Try section element instead. Save div for really odd-ball stuff.
Need help sorting out tags? Try A Book Apart series title "HTML5 for Web Designers", by Jeremy Kieth and Rachel Andrew. The tag hierarchy was established by W3C to keep things organized.
Ref:
https://abookapart.com/products/html5-for-web-designers
[Only 10 bucks, excellent half hour read]
http://45.32.170.63/BQRBTQT-htmlT-f0r-w3b-d3s83gn3rs%20htmlT-f0r-w3b-d3s83gn3rs-by-j3r3my-k383th.html
[Jeremy Kieth at Good Reads, original, pre HTML5]
http://mobilesoftware445.weebly.com/blog/download-free-a-book-apart-html5-for-web-designers-pdf
[Weebly at Media FIre, another free gander, this book's market integrity is really battered]
please put all css in the external css file, shrink page size download css once
I've been hearing lately that you want to inline (into the HTML head) a small amount of CSS used to render the above-the-fold content, for faster perceived performance. Slower connections don't have to download a huge external file with a lot of CSS properties for stuff not being used at the moment.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.