Here is code for footer section:
<footer>
<div class="footer">
<nav>
<ul class="nav-list1">
<li><img src="img/notes.png" alt="img"></li>
<li>ARTICLES</li>
<li>BLOG</li>
<li>COLUMN</li>
<li>TOPICS</li>
</ul>
<ul class="nav-list2">
<li>ABOUT</li>
<li>AUTHOURS</li>
<li>MASTHEAD</li>
<li>CONTRIBUTE</li>
<li>STYLEGUIDE</li>
<li>CONTACT</li>
<li>SPONSORSHIPS</li>
</ul>
</nav>
<hr class="hr-style" />
<section class="clearfix footerWidth">
<div class="footer-column1">
<img src="img/footer1.png" class="footer-image" alt="dot"/>
<p class="footer-title">.NET Training</p>
<p class="footer-pgf">If you have a .NET question on a topic that 's not covered by other more specific forums.</p>
<p><a class="footer-link" href="#">ask here. ></a></p>
</div>
<div class="footer-column2">
<img src="img/footer2.png" class="footer-image" alt="expert"/>
<p class="footer-title">Shopify Expert at $20 / hour</p>
<p class="footer-pgf">Unique custom made Shopify theme and tweaks.</p>
<p><a class="footer-link" href="#">click to view</a></p>
</div>
</section>
<hr class="hr-style" />
<p class="copyright">Copyright © 2013 Dot Net How</p>
</div>
</footer>
Here is my JSfiddle:
http://jsfiddle.net/d0teo50p/7/
In my page in footer section, right side of content didn't show properly.
Can anybody help me to fix this.
Set width:960px; to div.footer and style="float:left;" to div.footer-column2 > p.footer-title and remove width:110%; to p.footer-pgf.
TRY - DEMO
HTML
<div class="wrapper">
<header id="header">
<img src="http://s30.postimg.org/rlkl06s9d/logo.jpg" alt="logo" id="logo">
<h1>The Articles</h1>
<nav class="header-nav">
<ul>
<li>Articles</li>
<li><img src="img/icon.png" alt=""> Home</li>
</ul>
</nav>
</header>
<section id="section">
<article class="article">
<img src="http://s30.postimg.org/60fickvip/articles.jpg" alt="articles" />
<p class="comments">
by<span class="woo"> JOHN WOO</span>
<date>June 04, 2013, 22 Comments</date>
</p>
<h1 class="issue">Issue No 376</h1>
<p class="lorem">Lorem ipsum dolor sit amer, consectetur adipising elit Vestibulum eu ligula justo, ullamcorper viverraest. Donec viverra libero in tellus ullamcorper lobortis,. Nam nunc metus, molestie sit amet sagitis et, hendrenit quam. Ut hendrerit commodo nunc, eu euismod odio egestas a. Morbi felis lorem, convallis id scelerisque eget, faucibus eget lectus.</p>
<p class="dev-express">asp.net, .net, dev-express</p>
More
<div class="border-bottom"></div>
<div class="article1">
<img src="http://s30.postimg.org/anq5s389d/cat.png" alt="" />
<p class="comments">
by <span class="woo">JOHN WOO</span>
<date>June 04, 2013, 22 Comments</date>
</p>
<h1 class="issue">Issue No 375</h1>
<p class="lorem">Lorem ipsum dolor sit amer, consectetur adipising elit Vestibulum eu ligula justo, ullamcorper viverraest. Donec viverra libero in tellus ullamcorper lobortis,. Nam nunc metus, molestie sit amet sagitis et, hendrenit quam. Ut hendrerit commodo nunc, eu euismod odio egestas a. Morbi felis lorem, convallis id scelerisque eget, faucibus eget lectus.</p>
<p class="dev-express">asp.net, .net, dev-express</p>
More
</div>
</article>
<aside class="aside">
<img src="http://s30.postimg.org/hlpokah01/agencies.jpg" alt="agencies" />
<h3>From the Blog</h3>
<p class="windows">DAVID <i> on </i>c# Windows</p>
<p class="hex">How to convert System.Color to HTML color (hex)?</p>
<p class="sidebar-pgf">I'm working on an application that requires converting the back color of the panel to HTML that can be used as a div background color. Please help.</p>
view answer
</aside>
</section>
</div>
<footer>
<div class="footer">
<nav>
<ul class="nav-list1">
<li><img src=".http://s30.postimg.org/rhqrjxmrx/notes.png" alt="img"></li>
<li>ARTICLES</li>
<li>BLOG</li>
<li>COLUMN</li>
<li>TOPICS</li>
</ul>
<ul class="nav-list2">
<li>ABOUT</li>
<li>AUTHOURS</li>
<li>MASTHEAD</li>
<li>CONTRIBUTE</li>
<li>STYLEGUIDE</li>
<li>CONTACT</li>
<li>SPONSORSHIPS</li>
</ul>
</nav>
<hr class="hr-style" />
<section class="clearfix footerWidth">
<div class="footer-column1">
<img src="http://s30.postimg.org/ckiaix9jl/footer1.png" class="footer-image" alt="dot"/>
<p class="footer-title">.NET Training</p>
<p class="footer-pgf">If you have a .NET question on a topic that 's not covered by other more specific forums.</p>
<p><a class="footer-link" href="#">ask here.</a></p>
</div>
<div class="footer-column2">
<img src="http://s30.postimg.org/fm92svmoh/footer2.png" class="footer-image" alt="expert"/>
<p class="footer-title" style="float:left;">Shopify Expert at $20 / hour</p>
<p class="footer-pgf">Unique custom made Shopify theme and tweaks.</p>
<p><a class="footer-link" href="#">click to view</a></p>
</div>
</section>
<hr class="hr-style" />
<p class="copyright">Copyright © 2013 Dot Net How</p>
</div>
</footer>
CSS
* {
box-sizing:border-box;
}
body {
font-family:Raleway, sans-serif;
text-decoration:none;
line-height:1.42857143;
margin:0;
}
html {
position:relative;
min-height:100%;
}
.wrapper {
width:960px;
margin-left:auto;
margin-right:auto;
}
#header {
margin:10px;
}
#header nav {
float:right;
margin-top:15px;
}
#header nav li {
display:inline-block;
}
#logo {
padding-bottom:40px;
border-bottom:solid 2px #CCC;
}
.view {
color:#FF8C00;
}
.hr-style {
background:url(http://s27.postimg.org/4sfiqgx7j/horizontal_lin
e.png) 50% 0 repeat-x;
border:0;
height:15px;
}
a {
text-decoration:none;
font-size:12px;
}
i {
font-weight:100;
}
img {
vertical-align:middle;
border:0;
}
.header-nav ul li {
display:inline;
float:right;
font-size:12px;
padding:10px;
}
.header-nav ul li a {
color:gray;
}
.comments,date {
color:gray;
font-size:12px;
font-style:italic;
}
.woo {
color:#FF8C00;
font-style:normal;
font-size:15px;
}
.lorem {
color:gray;
font-size:13px;
line-height:25px;
letter-spacing:.07pt;
width:86%;
}
.border-bottom {
border-bottom:1px solid gray;
width:90%;
padding-top:15px;
}
.dev-express {
font-size:12px;
font-family:Arial Narrow;
color:gray;
letter-spacing:1pt;
}
.article1 {
margin-top:15px;
}
.myButton {
background-color:#FF8C00;
border-radius:4px;
display:inline-block;
cursor:pointer;
color:#fff;
font-size:13px;
text-decoration:none;
padding:6px 18px;
}
.myButton:hover {
background-color:#FF8C00;
}
.myButton:active {
position:relative;
top:1px;
}
#section {
display:table;
}
.article {
width:75%;
padding-bottom:50px;
display:table-cell;
vertical-align:top;
}
.aside {
display:table-cell;
vertical-align:top;
width:25%;
}
.issue {
color:#FF8C00;
font-size:25px;
font-weight:400;
}
.windows {
font-weight:600;
font-size:12px;
}
.hex {
font-weight:600;
color:#FF8C00;
}
.sidebar-pgf {
font-size:13px;
line-height:23px;
letter-spacing:.07pt;
}
nav {
text-align:center;
}
.nav-list1 li {
display:inline;
font-size:12px;
font-weight:700;
letter-spacing:.2pt;
padding:15px;
}
.nav-list2 li {
display:inline;
font-size:11px;
font-weight:800;
letter-spacing:.2pt;
padding:15px;
}
.footer {
background-image:url(http://s27.postimg.org/80k03ijhb/footer_bg.jpg);
bottom:0;
clear:both;
height:auto;
padding:15px;
width:960px;
}
.footer-image {
float:left;
padding-right:13px;
}
.footer-title {
font-weight:700;
font-size:12px;
}
.footer-pgf {
font-size:11px;
}
.footer-link {
font-size:11px;
font-weight:600;
}
.copyright {
font-size:12px;
font-weight:500;
text-align:center;
}
.clearfix:after {
visibility:hidden;
display:block;
font-size:0;
content:" ";
clear:both;
height:0;
}
.column4-pgf {
font-size:11px;
}
.well {
background-color:#f5f5f5;
border:#e3e3e3 solid 1px;
border-radius:4px;
box-shadow:0 1px 1px rgba(0,0,0,0.05) inset;
margin-bottom:20px;
min-height:20px;
padding:19px;
}
.footer-column2 {
margin-left:45px!important;
}
section.footerWidth {
width:960px;
margin:0 auto;
}
#header h1,.footer-column1,.footer-column2 {
float:left;
}
#media min-width992px{
.column-1,.column-2,.column-3,.column-4,.footer-column1,.footer-column2 {
min-height:1px;
padding-left:15px;
padding-right:15px;
position:relative;
}
}
#media min-width 992px{
.footer-column1,.footer-column2 {
width:45%;
margin-left:15px;
}
}
Image:
Related
I come here to ask a question I've begin yesterday a project so I currently do a prototype of my design
I've begin my CSS in mobile first but when I using my media query, the mobile first property get override and take the tablet query as my main css and i don't understand why :/
here is the html
<div id="container">
<section id="mysect1">
<h2> Presentation </h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</section>
<section id="mysect2">
<h2> Produits </h2>
<img src="./assets/images/fauteuil.png">
<img src="./assets/images/tensio.png">
<img src="./assets/images/inco.png">
<img src="./assets/images/lit.png">
</section>
and here my CSS
#mysect1 p {
font-size:1.1em;
}
#mysect2{
text-align:center;
}
#mysect2 img {
width:90%;
}
#media (min-width:768px) {
#mysect1 p {
font-size:1.8em;
}
#mysect2 {
text-align:center;
}
#mysect2 img {
width:70%;
}
}
thanks !
You need to define a separate media query for mobile
#media (min-width:480px) {
#mysect1 p {
font-size:1.1em;
}
#mysect2{
text-align:center;
}
#mysect2 img {
width:90%;
}
}
the problem here is my #media(min-width:768px) override my phone query when i'm on phone emulator ( on google dev)
here is my complet HTMl
<!DOCTYPE html>
<html>
<head>
<title> BLCM Tunisie </title>
<link rel="stylesheet" type="text/css" href="assets/css/main.css">
</head>
<body>
<header>
<nav id="navbar">
<div id="logo"><img src="./assets/images/bastide.jpg"></div>
<div id="op-horizontalnav">
<ul class="op-sectionlist">
<li class="op-v-item"><a class="op-v-link" href="#mysect1">PRESENTATION</a></li>
<li class="op-v-item"><a class="op-v-link" href="#mysect2">PRODUITS</a></li>
<li class="op-v-item"><a class="op-v-link" href="#mysect3">EQUIPE</a></li>
<li class="op-v-item"><a class="op-v-link" href="#mysect4">CONTACT</a></li>
</ul>
</div>
</nav>
</header>
<div id="container">
<section id="mysect1">
<h2> Presentation </h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</section>
<section id="mysect2">
<h2> Produits </h2>
<img src="./assets/images/fauteuil.png">
<img src="./assets/images/tensio.png">
<img src="./assets/images/inco.png">
<img src="./assets/images/lit.png">
</section>
<section id="mysect3">
<h2> Equipe </h2>
<div id="imageTeam">
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerome Yvanez <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jean bon <br/> Web marketer</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jesui Palas <br/> CM</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Sylla Bique <br/> Graphiste </p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Mac Donald <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
<div class="imgWrapper"><img src="./assets/images/jerome.jpg"><p> Jerry Golay <br/> Developper</p> </div>
</div>
</section>
<section id="mysect4">
<h2> Nous contacter </h2>
<form action="post">
<input placeholder=" Nom et Prénom" type="text" id="firstname">
<input type="text" id="email" placeholder="email">
<input type="text"size="6" id="contactContent" placeholder ="contenue du message">
<input type="submit" id="send"/>
</form>
</section>
</div>
<footer></footer>
</body>
</html>
and here my complet CSS
html, body {
border: 0;
font-family: Helvetica LT Condensed;
font-size: 12px;
font-weight: normal;
font-style: normal;
text-decoration: none;
width:100%;
}
body{
background: url(../images/fond.png);
background-size: 200%;
background-repeat: repeat;
background-position-x: 60%;
background-position-y: 118%;
}
section {
padding:20px;
}
h2, h3 {
text-align:center;
font-size:4em;
}
#container{
margin-top:150px;
}
/*============ CSS 'Header' mobile first ========== */
header.active #logo img {
width:100px;
height:40px;
margin:4px 0 0 20px;
padding-left:40px;
}
#logo { text-align:left; }
#logo img{
width:140px;
height:55px;
transition: .4s all linear;
-moz-transition: .4s all linear;
-webkit-transition: .4s all linear;
-o-transition: .4s all;
margin:14px 0 0 20px;
display:block;
}
header{
color:white;
position:fixed;
background-color:black;
text-align:right;
right:0;
top:0;
left:0;
z-index:501;
height:80px;
}
#navbar {
text-align:right;
position:relative;
font-size:19px;
}
ul { margin-top:-34px; }
li{
display:inline;
margin-top:;
padding-right:50px;
transition: .4s all linear;
-moz-transition: .4s all linear;
-webkit-transition: .4s all linear;
-o-transition: .4s all linear;
}
.active li{
font-size:0.8em;
padding-top:20px,
padding-right:40px;
}
.active ul { margin-top:-30px; }
a.active {
background-color:red;
color:white;
padding:5px;
font-weight:bold;
}
a{ text-decoration: none; color:white;}
#media(min-width: 480px){
/* =========== CSS 'Presentation' mobile first =========== */
#mysect1 p {
font-size:1.1em;
}
/* =========== CSS 'Produits' ============= */
#mysect2{
text-align:center;
}
#mysect2 img {
width:90%;
}
/* ========== CSS 'Equipe' mobile-first ===========*/
#imageTeam {
text-align:center;
padding-top:20px;
order:2;
}
.imgWrapper { display:inline-block; width: 42%; }
.imgWrapper p {
background-color:red;
padding:20px 117px 21px 110px;
color:white;
margin-top:-5px;
width:inherit;
font-size:39px;
display:inline-block;
}
#imageTeam img{ width:100%;
}
/*=========== CSS 'Contact' mobile first ============= */
form {
width:100%;
}
input, textarea, select {
font-size:44px;
margin-top:25px;
padding:10px;
box-sizing:border-box;
background:none;
outline:none;
resize:none;
border:0;
transition:all .3s;
border-bottom:1px solid #F7941D;
border-right:1px solid #F7941D;
width:100%;
}
input:focus { border-bottom:3px solid #F7941D; border-right:3px solid #F7941D;}
#send {
padding: 15px;
background-color: #F7941D;
margin-bottom: -6px; }
#send:hover{ background-color:#B40303; }
#contactContent { height:100px; }
#mysect4 {
padding: 0 10px 0 0px;
margin-left: -6px;
}
}
/*============== DEBUT CSS TABLETTE ============= */
#media (min-width:768px) {
/*============== CSS 'Presentation' TABLETTE =============*/
#mysect1 p {
font-size:1.8em;
}
/*============= CSS 'Produits' TABLETTE =================*/
#mysect2 {
text-align:center;
}
#mysect2 img {
width:70%;
}
.imgWrapper {
width:35%;
}
#imageTeam img {
width: 86%;
}
#imageTeam p {
padding:10px 85px 12px 84px;
font-size: 21px;
}
}
this is a pics of what I tell
Inside a div I want a full width background color and center the content inside. I have read in some other posts that it needs an outer div to set the background-color there, and then an inner div with the width of my content and margin:0 auto;. I tried that but it doesn't work. I tried floating my content left and this didn't work either.
Here is my code. The problem is in the div class="themeDesign" where i put the background color. In the div class="themeDesignicons" when i put width:1000px the one of the li elements extends onto the next line, but with width:1300px they appear on the same line without centering. Why? Does it matter first-child? I cant go on. Thanks in advance
*{
margin:0px;
padding:0px;
}
body{
width:100%;
}
header{
background-color:#088da5;
overflow:hidden;
padding:15px 0;
}
.main-header{
width:1300px;
margin:0 auto;
}
.main-header .left-mainheader{
float:left;
margin-right:400px;
}
.main-header .left-mainheader ul li{
display:inline-block;
margin-right:26px;
}
.main-header .left-mainheader li a{
text-decoration:none;
color:white;
}
.main-header .right-mainheader{
float:left;
}
.main-header .right-mainheader ul li{
display:inline-block;
margin-right:15px;
}
.main-header .right-mainheader ul li a{
text-decoration:none;
color:white;
}
.left-mainheader img{
padding-right:8px;
}
header .header h1{
background-image:url(images/logoheader.png);
width:440px;
height:84px;
margin:60px auto;
overflow:hidden;
clear:both;
}
.header ul{
margin:25px auto;
width:440px;
}
.header li {
display:inline-block;
margin:0 15px 0 0;
}
.header li a{
color:black;
text-decoration:none;
font-size:15px;
font-family: tahoma;
}
header li a:hover{
text-decoration:underline;
}
.header .headermesa{
border-top:1px solid #666633;
}
.slider{
background-color:#f7f8fa;
}
.slidermesa{
margin:0 auto;
width:1200px;
height:421px;
}
.slide img{
border-top:1px solid #666633;
width:1200px;
height:421px;
}
.themeDesign{
background-color:#f7f8fa;
}
.themedesignheadings{
margin:0 auto;
width:1000px;
padding:35px 0;
border-bottom:1px dashed #877676;
}
.themeDesignicons{
width:1000px;
margin:0 auto;
}
.themeDesignicons ul li{
display:inline-block;
width:250px;
}
<!DOCTYPE html>
<html>
<head>
<title>-Tutorial for psd-revenant</title>
<meta charset="utf-8">
</head>
<body>
<header>
<div class="main-header">
<div class="left-mainheader">
<ul>
<li>
<img src="images/phoneIcon-header.png"/> +565 975 658
</li>
<li>
<img src="images/emailheader3.png"/>info#premiumcoding.com
</li>
<li>
<img src="images/timeheader2_03.png"/>Monday-Friday : 8.00-20.00
</li>
</ul>
</div>
<div class="right-mainheader">
<ul>
<li>Latest News</li>
<li>Login</li>
<li>Register</li>
<li>About Us</li>
</div>
</div>
<div class="header">
<h1></h1>
<div class="headermesa">
<ul>
<li>Home</li>
<li>Apparel</li>
<li>Fashion</li>
<li>News</li>
<li>Portfolio</li>
<li>Contact</li>
</ul>
</div>
</div>
</header>
<div class="slider">
<div class="slidermesa">
<div class="slide">
<img src="images/mainslide.png"/>
</div>
</div>
</div>
<div class="themeDesign">
<div class="themedesignheadings">
<h2>Check our latest Wordpress Theme which implements a Page Builder and a Revolution Slider</h2>
<p>Learn how to build Wordpress Themes with ease with a premium Page Builder which allows you to add new Pages in seconds!</p>
</div>
<div class="themeDesignicons">
<ul>
<li>
<div class="disc-cam">
<div class="icon cam2"></div>
</div>
<div class="disc-text">
<h3>Responsive Design</h3>
<p>Lorem ipsum dolor sit amet, co
ctetuer adipiscing elit, sed di
nonummy nibh euismod te.</p>
Read More<img src="images/arrow.png"/>
</div>
</li>
<li>
<div class="disc-cam">
<div class="icon cam2"></div>
</div>
<div class="disc-text">
<h3>Responsive Design</h3>
<p>Lorem ipsum dolor sit amet, co
ctetuer adipiscing elit, sed di
nonummy nibh euismod te.</p>
Read More<img src="images/arrow.png">
</div>
</li>
<li>
<div class="disc-cam">
<div class="icon cam2"></div>
</div>
<div class="disc-text">
<h3>Responsive Design</h3>
<p>Lorem ipsum dolor sit amet, co
ctetuer adipiscing elit, sed di
nonummy nibh euismod te.</p>
Read More<img src="images/arrow.png">
</div>
</li>
<li>
<div class="disc-cam">
<div class="icon cam2"></div>
</div>
<div class="disc-text">
<h3>Responsive Design</h3>
<p>Lorem ipsum dolor sit amet, co
ctetuer adipiscing elit, sed di
nonummy nibh euismod te.</p>
Read More<img src="images/arrow.png">
</div>
</li>
</ul>
</div>
</div>
Try this
.themeDesignicons {
width: auto;
margin: 0 auto;
text-align: center;
}
This is my html5 code for footer:
<footer>
<div class="footer">
<nav class="footer-nav">
<ul class="list-1">
<li><img src="img/notes.png" alt="" /></li>
<li>ARTICLES</li>
<li>COLUMNS</li>
<li>BLOG</li>
<li>TOPICS</li>
</ul>
<ul class="list-2">
<li>ABOUT</li>
<li>AUTHORS</li>
<li>MASTHEAD</li>
<li>CONTRUBUTE</li>
<li>STYLE GUIDE</li>
<li>CONTACT</li>
<li>SPONSORSHIPS</li>
</ul>
</nav>
<hr class="hr-style">
<div class="row">
<div class="footer-left">
<img src="img/footer1.png" alt="footer-image" />
<p class="footer-title">.NET Training</p>
<p class="footer-pgf">Less of boring theory! Hands on programming is our training methodology! You'll love it.<p>
learn more
</div>
<div class="footer-right">
<img src="img/footer2.png" alt="footer-image" />
<p class="footer-title">Shopify Expert at $20/hour</p>
<p class="footer-pgf">Unique custom made shopify theme and tweakss. Strat selling online with stunning eCommerce storefronts created using the Shopify CMS</p>
learn more
</div>
</div>
<hr class="hr-style">
<p class="copyright">Copyright © 2013 Dot Net How</p>
</div>
</footer>
and css:
.footer{
clear:both;
background:url('../img/footer-bg.jpg');
overflow: hidden;
}
.footer-left{
float:left;
width: 50%;
}
.footer-right{
float:right;
width:50%;
}
.footer-nav .list-1 {
font-size:13px;
font-weight:600;
text-align: center;
}
.footer-nav .list-2 {
font-size:12px;
font-weight:600;
text-align: center;
}
.footer-nav ul li{
display:inline;
padding:8px;
}
img{
vertical-align: middle;
}
.copyright{
font-size:13px;
text-align: center;
}
.footer-left:after,.footer-right:after{
clear:both;
content: "";
}
.row{}
In footer i added <hr /> two places, such as top of footer content and top of footer copyright, but it shows only in top footer-content.
What is my mistake, please help me.
This is JSfiddle link what i tried: http://jsfiddle.net/3jet0dfu/14/
You are missing a clear both div
<div style="clear:both;"></div>
inside the
<div class="row">
<div class="footer-left">...</div>
<div class="footer-right">...</div>
</div>
Please see the JSFiddle here
http://jsfiddle.net/3jet0dfu/15/
Try this
<html>
<head>
<style>
.footer
{
clear:both;
background:url('../img/footer-bg.jpg');
overflow: hidden;
}
.footer-left
{
float:left;
width: 50%;
}
.footer-right
{
float:right;
width:50%;
}
.footer-nav .list-1
{
font-size:13px;
font-weight:600;
text-align: center;
}
.footer-nav .list-2
{
font-size:12px;
font-weight:600;
text-align: center;
}
.footer-nav ul li
{
display:inline;
padding:8px;
}
img
{
vertical-align: middle;
}
.copyright
{
font-size:13px;
text-align: center;
}
.footer-left:after,.footer-right:after
{
clear:both;
content: "";
}
.a
{
width:500;
float:left;
}
.row{}
</style>
</head>
<body>
<div style="width:1000;margin:0 auto;">
<header>
<img src="http://s18.postimg.org/tvw52r1ux/logo.jpg" alt="logo">
<h1>The Articles</h1>
<nav class="header-nav">
<ul>
<li><img src="http://s12.postimg.org/hyaxg6xah/icon.png" alt="">Home</li>
<li>Articles</li>
</ul>
</nav>
</header>
<section id="section">
<div class="a">
<article class="article">
<div>
<img src="http://s18.postimg.org/7l8a2s4kp/articles.jpg" alt="articles" />
<p class="comments">by<span class="woo"> JOHN WOO</span>
<date>June 04, 2013, 22 Comments</date></p>
<h1 class="issue">Issue No 376</h1>
<p class="lorem">Lorem ipsum dolor sit amer, consectetur adipising elit Vestibulum eu ligula justo, ullamcorper viverraest. Donec viverra libero in tellus ullamcorper lobortis,. Nam nunc metus, molestie sit amet sagitis et, hendrenit quam. Ut hendrerit commodo nunc, eu euismod odio egestas a. Morbi felis lorem, convallis id scelerisque eget, faucibus eget lectus.</p>
<p class="dev-express">asp.net, .net, dev-express</p>
More
</div>
<div>
<img src="http://s18.postimg.org/dnfwt9t0p/cat.png" alt="" />
<p class="comments">by <span class="woo">JOHN WOO</span> <date>June 04, 2013, 22 Comments</date></p>
<h1 class="issue">Issue No 375</h1>
<p class="lorem">Lorem ipsum dolor sit amer, consectetur adipising elit Vestibulum eu ligula justo, ullamcorper viverraest. Donec viverra libero in tellus ullamcorper lobortis,. Nam nunc metus, molestie sit amet sagitis et, hendrenit quam. Ut hendrerit commodo nunc, eu euismod odio egestas a. Morbi felis lorem, convallis id scelerisque eget, faucibus eget lectus.</p>
<p class="dev-express">asp.net, .net, dev-express</p>
More
</div>
</article>
</div>
<div class="a">
<aside class="aside" style="margin:0 0 0 200;">
<img src="http://s18.postimg.org/51cn8oh0p/agencies.jpg" alt="agencies" />
<h3>From the Blog</h3>
<p class="windows">DAVID <i> on </i>c# Windows</p>
<p class="hex">How to convert System.Color to HTML color (hex)?</p>
<p class="sidebar-pgf">I'm working on an application that requires converting the back color of the panel to HTML that can be used as a div background color. Please help.</p>
<a class="view" href="#">view answer</a>
</aside>
</div>
</section>
<footer>
<div class="footer">
<nav class="footer-nav">
<ul class="list-1">
<li><img src="http://s18.postimg.org/4xe8eom5h/notes.png" alt="" /></li>
<li>ARTICLES</li>
<li>COLUMNS</li>
<li>BLOG</li>
<li>TOPICS</li>
</ul>
<ul class="list-2">
<li>ABOUT</li>
<li>AUTHORS</li>
<li>MASTHEAD</li>
<li>CONTRUBUTE</li>
<li>STYLE GUIDE</li>
<li>CONTACT</li>
<li>SPONSORSHIPS</li>
</ul>
</nav>
<hr class="hr-style">
<div class="row">
<div class="footer-left">
<img src="http://s18.postimg.org/itr24b7s9/footer1.png" alt="footer-image" />
<p class="footer-title">.NET Training</p>
<p class="footer-pgf">Less of boring theory! Hands on programming is our training methodology! You'll love it.<p>
learn more
</div>
<div class="footer-right">
<img src="http://s18.postimg.org/gl8a98bah/footer2.png" alt="footer-image" />
<p class="footer-title">Shopify Expert at $20/hour</p>
<p class="footer-pgf">Unique custom made shopify theme and tweakss. Strat selling online with stunning eCommerce storefronts created using the Shopify CMS</p>
learn more
</div>
</div>
<hr class="hr-style">
<p class="copyright">Copyright © 2013 Dot Net How</p>
</div>
</footer>
</div>
</body>
</html>
<div id="navMenu">
<div id="navigation_horiz">
<ul>
<li>
Find a Doctor
</li>
<li>
Why Interfaith
<div class="dropdown" id="dropdown_one">
<div class="test" style="padding: 10px;">History & Mission</div>
<div class="test" style="padding: 10px;">Executive Director</div>
<div class="test" style="padding: 10px;">Career Opportunities</div>
<div class="test" style="padding: 10px;">News & Events</div>
</div>
<!-- .dropdown_menu -->
</li>
<li>
Medical Services
<div class="dropdown" id="dropdown_one">
<div class="test" style="padding: 10px;">
Behavioral Health
</div>
<div class="test" style="padding: 10px;">Clinical Laboratory</div>
<div class="test" style="padding: 10px;">Dentistry</div>
<div class="test" style="padding: 10px;">Emergency</div>
<div class="test" style="padding: 10px;">Gynecology</div>
<div class="test" style="padding: 10px;">Medicine</div>
<div class="test" style="padding: 10px;">Pastoral</div>
<div class="test" style="padding: 10px;">Pediatrics</div>
<div class="test" style="padding: 10px;">Physical Medicine & Rehab</div>
<div class="test" style="padding: 10px;">Radiology</div>
<div class="test" style="padding: 10px;">Surgery</div>
<div class="test" style="padding: 10px;">Other Services</div>
</div>
<!-- .dropdown_menu -->
</li>
<li>
Medical Trainings
<div class="dropdown" id="dropdown_one">
<div class="test" style="padding: 10px;">Medical Training</div>
<div class="test" style="padding: 10px;">Behavioral Health</div>
<div class="test" style="padding: 10px;">Predoctoral Externship</div>
<div class="test" style="padding: 10px;">Podiatric Residency</div>
<div class="test" style="padding: 10px;">Dental Residency</div>
<div class="test" style="padding: 10px;">Pulmonary Residency</div>
</div>
<!-- .dropdown_menu -->
</li>
<li>
For Patients & Visitors
<div class="dropdown" id="dropdown_three">
<p>
This is a Link
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin blandit
sodales justo, id fringilla eros dapibus vitae. Morbi molestie enim diam,
a vulputate neque. Morbi sit amet nunc id quam mollis aliquet. Donec sed
massa justo, ut congue enim. Praesent lobortis viverra dolor commodo euismod.</p>
</div>
<!-- .dropdown_menu -->
</li>
<li>
Contact Us
</li>
</ul>
</div>
<!-- #navigation_horiz -->
</div>
<!-- END NAVIGATION -->
And i have the following CSS:
#navMenu {
width: 960px;
height: 50px;
border: 1px solid black;
}
/* * {margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; line-height:16px} */
.container {margin:0px auto; width:960px; background:#fff; padding:0px;}
/* ----------------------------------------------------- */
/* navigation styles - BEGIN */
/* style for horizontal nav */
#navigation_horiz {width:960px; clear:both; padding:0 0 0 0; margin:0 auto}
#navigation_horiz ul {height:40px; display:block}
#navigation_horiz ul li {display:block; float:left; width:160px; height:40px; background:#999; margin:0 1px 0 0; position:relative}
#navigation_horiz ul li a.navlink {display:block; width:160px; height:35px; padding: 12px 0 0 0; text-align:center; color:#fff; text-decoration:none}
#navigation_horiz .dropdown {position:absolute; padding:5px 10px 5px 10px; border-bottom-right-radius:10px; border-bottom-left-radius:10px; -moz-border-radius-bottomright:10px; -moz-border-radius-bottomleft:10px}
/* style for each drop down - horizontal */
#navigation_horiz ul li #dropdown_one {background:#ccc; color:#fff}
#navigation_horiz ul li #dropdown_one a {color:red}
#navigation_horiz ul li #dropdown_two {background:#ccc; color:#fff}
#navigation_horiz ul li #dropdown_two a {color:black}
#navigation_horiz ul li #dropdown_three {background:#ccc; color:#fff}
#navigation_horiz ul li #dropdown_three a {color:gray}
For some reason the UL list is coming in the center instead of starting from LEFT of the DIV and stretch all the way to the right. you can see what it looks like here: http://i46.tinypic.com/2wnz7g1.gif
Any idea?
Thanks
ul has 40px padding-left by default, set padding: 0; and it will fix the horizontal position.
ul { padding: 0; }
Apply margin:0 (instead of margin: 0 1px 0 0) to #navigation_horiz ul li as well as #navigation_horiz ul (assuming you aren't using a css reset; also add padding:0 to the ul as well.)
Here: jsFiddlyFooFoo
User agent styles usually have padding and margin on ul just remove them
#navMenu ul{
padding: 0;
margin: 0;
}
Also your li take up more width than the ul so it wraps, you add 1px magin to each li so 1x6=6 extra pixels
http://jsfiddle.net/EJttX/1/
I'm working on a new project, and it appears that both opera and IE are giving me extra space to my li element.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#import "stil.css";
</style>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="reel.js"></script>
<script type="text/javascript" src="dropdown.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Savic</title>
</head>
<body>
<div id="container">
<div id="header">
<div id="menu">
<p> Samostalna Zanatska Radnja</p>
<a id="logo" href="index.html">Savić</a>
<div id="darrow">
</div>
<div id="darrow2">
</div>
<ul id="nav">
<li><a class="link" style="background:url(images/activeb.jpg) repeat-x" href="#">Početna</a></li>
<li><a class="link" id="izb" href="#">Izrada</a></li>
<li><a class="link" id="ugb" href="#">Ugradnja</a></li>
<li><a class="link" href="#">Galerija</a></li>
<li><a class="link" href="#">Kontakt</a></li>
</ul>
<ul id="izd">
<li>Ograda</li>
<li>Kapija</li>
<li>Gelendera</li>
<li>Čelične konstrukcije</li>
<li>Garažnih vrata</li>
</ul>
<ul id="ugd">
<li>Kupatila</li>
<li>Vodovoda</li>
<li>Kanalizacije</li>
<li>Grejanja</li>
<li>Servis pumpi za vodu</li>
</ul>
</div>
</div>
<div id="body">
<!-- ALL STUFF GOES HERE -->
<div id="holder">
<!-- LEVI DIV -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<div id="left">
<div id="portfolio_cycler" class="shadow roundbox">
<img class="active" src="images/reel1.jpg" />
</div>
<div id="circles"></div>
<img id="horg" src="images/horg.jpg" />
<div id="topt">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris pellentesque semper ligula at volutpat. In hac habitasse platea dictumst. Nam ultrices diam eu dolor cursus in semper ligula faucibus. Nulla mattis tortor vel nunc rutrum convallis. Maecenas egestas diam sit amet odio mattis sit amet pellentesque orci bibendum. Ut sodales fringilla sem, nec volutpat mi scelerisque non. Phasellus luctus laoreet nunc, eget tincidunt massa egestas vel. Phasellus id sapien ante. Fusce vulputate, urna quis condimentum molestie, erat sapien porttitor dui, eu pulvinar orci enim non massa. Mauris in cursus mauris. Sed tortor justo, placerat tristique blandit at, rutrum quis nisi.</p>
</div>
</div>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- LEVI DIV KRAJ -->
</div>
<!-- ALL STUFF ENDS HERE -->
</div>
<div id="footer"></div>
</div>
</body>
</html>
CSS:
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,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
/*NEOPHODNO ZA FOOTER */
/*<div id="container">
<div id="header">
<div id="menu">
</div>
</div>
<div id="body">
Sve stavljati u body, kao i margin: 0 auto, ne treba wrap div
</div>
<div id="footer"></div>
</div>
*/
html,
body {
margin:0;
padding:0;
height:100%;
}
#container {
min-height:100%;
position:relative;
}
#header {
background:url(images/background.jpg) repeat-x;
height:100px;
}
#body {
width:980px;
margin:0 auto;
padding-bottom:60px; /* Height of the footer */
}
#footer {
position:absolute;
bottom:0;
width:100%;
height:25px; /* Height of the footer */
background:url(images/footer.jpg) repeat-x;
}
#wrap{
width:980px;
margin:0 auto;
background:#000;
height:100px;
}
/* FOOTER PODESAVANJA */
#menu{
width:980px;
margin:0 auto;
position:relative;
top:2px;
height:98px;
background:url(images/header2.jpg) 0px 0px;
}
#holder{
width:960px;
position:relative;
left:10px;
top:10px;
}
#menu p,a,li{
font-family:Arial, Helvetica, sans-serif;
color:#FFF;
font-weight:bold;
position:relative;
}
#menu p{
font-size:12px;
left:55px;
top:10px;
width:200px;
}
#logo{
font-size:40px;
top:5px;
left:80px;
text-decoration:none;
}
#nav li{
font-size:12px;
display:inline;
}
#nav ul{
position:relative;
height:20px;
}
#nav{
position:relative;
top:10px;
left:0px;
}
#nav a{
font-size:12px;
padding-right:14px;
padding-left:14px;
}
.link{
padding-top:5px;
padding-bottom:5px;
text-decoration:none;
top:1px;
}
#portfolio_cycler{position:relative;}
#portfolio_cycler img{position:absolute;z-index:1}
#portfolio_cycler img.active{z-index:3}
#circles{
position:absolute;
z-index:7;
top:250px;
left:690px;
}
#izd{
width:130px;
background:#48a9c4;
position:absolute;
z-index:5;
font-size:12px;
text-align:center;
top:98px;
left:60px;
height:120px;
}
#ugd{
width:130px;
background:#48a9c4;
position:absolute;
z-index:5;
font-size:12px;
text-align:center;
top:98px;
left:146px;
height:120px;
}
#izd li, #ugd li{
list-style:none;
padding-top:3px;
padding-bottom:5px;
}
#izd a, #ugd a{
text-decoration:none;
display:block;
width:130px;
}
#izb{
visibility:visible;
}
#darrow{
position:absolute;
left:130px;
top:80px;
background:url(images/darrow.png) no-repeat;
width:10px;
height:12px;
z-index:5;
}
#darrow2{
position:absolute;
left:214px;
top:80px;
background:url(images/darrow.png) no-repeat;
width:10px;
height:12px;
z-index:5;
}
#horg{
position:relative;
top:277px;
}
#topt{
position:relative;
width:770px;
top:283px;
text-align:justify;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}
I don't want to create special css or use javascript to fix this, so can anyone tell me what's the problem. I assume that id nav causes the problem but I'm not sure.
The problem is with your CSS. Try adding these:
#nav {
margin: 0;
padding: 0;
}
#nav li {
/* use this instead of display:inline */
float: left;
display: block;
}
Those are just some fixes to the bugs that I can quickly spot. There might be more bugs. If you want to learn how to make a horizontal menu with CSS, check out my tutorial on Cramie.net - Create CSS Horizontal Menu