I am developing a website using the 960 Grid system.
I have 3 parts to the header. The logo, the navigation, and the login form.
I have media queries set to center both the logo and the login when the page gets below 1614 pixels. The issue is that while the logo centers, the div containing the log in does not.
Here is an screen shot with highlighting around the divs to show the issue.
Webpage
Heres an attempted fiddle
http://jsfiddle.net/6m8K7/
I'm not sure what is causing this.
HTML
<div id="header">
<div id="logoHolder">
<a href="index.html">
<img src="images/Pinnacle_ira logo_web.png" alt="Pinnacle IRA" width="125" height="84"/>
</a>
</div>
<div id="loginHolder">
<form action="https://www.theiracenter.com/customerLoginAction.gsx" method="post" >
<label for="username">Username:</label>
<input class="topLogin" type="text" name="login" />
<br />
<label for="password">Password:</label>
<input class="topLogin" id="passwordText" type="password" name="password" />
<input type="hidden" name="pd" value="C05" />
<br />
<input type="submit" />
</form>
</div>
<br />
<div class="container_12">
<div class="grid_12">
<div id="navigationHolder">
<ul id="navigation">
<li>GuidedChoice</li>
<li>Pricing</li>
<li>FAQs</li>
<li>Investment Tools</li>
<li>Contact Us</li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
</div>
CSS
/*Header*/
#logoHolder{
float:left;
}
#logoHolder img{
margin:5px;
margin-top:20px;
vertical-align:bottom;
}
#media (min-width:0px) and (max-width:1614px){
#logoHolder{
width:125px;
float:none;
display:block;
margin-left:auto;
margin-right:auto;
}
}
#loginHolder{
float:right;
}
#media (min-width:0px) and (max-width:1614px){
#loginHolder{
display:block;
margin-left:auto;
margin-right:auto;
}
}
label{
font-family:Arial;
}
.topLogin{
width:175px !important;
height:20px !important;
}
#passwordText{
margin-left:22px;
}
#navigationHolder{
display:block;
margin-left:auto;
margin-right:auto;
width:775px;
background-color:brown;
height:auto;
}
/*Navigation*/
#navigation{
list-style:none;
font-family:Arial;
font-size:1.3em;
}
#navigation li{
float:left;
display:block;
color:#888888;
margin-top:20px;
}
#navigation li:hover{
color:white;
}
#navigation li a{
color:inherit;
text-decoration:none;
display:block;
text-align:center;
padding:1.25em;
padding-bottom:3.5em;
}
#navigation li a:hover{
background:#609941;
text-decoration:underline;
}
Is there any particular reason you have two decelerations of?
#media (min-width:0px) and (max-width:1614px){
Either way, simply adding float:none to the #loginHolder selector should do the trick. -This would need to be placed in your second deceleration of the same break point.
Related
I have worked very hard on this website but i have ran into an annoyance that I cannot seem to figure out! I am using Mozilla Firefox and unlike other webpages, when I zoom everything moves out of place! Usually that only happens when you resize but for some reason it is doing it for zoom also!! How can I fix this? Here is the code bellow:) Thanks! P.S. My zoom is at 90%, if there is a way to automatically set the zoom of browser when the user opens the page, please let me know!
*{margin:0; padding:0;}
.container{
width:100%;
height:100%;
background-image:url(backgrounds/background4.jpg);
background-size: cover;
overflow:hidden;
}
body{
width:100%;
}
.mainHeader{
width:100%;
height:100px;
background-color:rgba(0,0,0,0.6);
/*background-color:#182418;*/
/*opacity:0.7;*/
}
.mainHeader nav ul{
margin-right:70px;
float:right;
}
.mainHeader nav ul li{
display:inline-block;
margin-top:30px;
margin-right:20px;
}
.mainHeader nav ul li a{
text-decoration:none;
font-family:Arial;
font-size:25px;
color:#ACACAC;
margin-right:30px;
}
.mainHeader nav ul li a.active{
color:white;
}
.mainHeader nav ul li a:hover{
color:white;
}
.mainHeader img{
margin-top:-25px;
}
.mainArea .panel{
margin-left:25%;
margin-top:2%;
width:50%;
height:620px;
background-color:rgba(0,0,0,0.6);
}
.mainArea .panel h1{
color:white;
font-family:Arial;
padding:50px;
padding-left:60px;
text-align:center;
}
.mainArea .panel p{
color:white;
font-family:Arial;
padding:30px 50px 50px 50px;
text-align:center;
font-size:25px;
}
.mainArea .panel form{
margin-right:33%;
position:relative;
top:-5%;
float:right;
}
.mainArea .panel form .name, .email{
width:300px;
height:40px;
border-radius:10px;
margin-bottom:40px;
background:rgba(0, 0, 0, 0.55);
border:none;
padding-left:20px;
font-family:Arial;
font-size:20px;
color:gray;
}
.mainArea .panel form .body{
resize:none;
width:300px;
height:200px;
border-radius:10px;
margin-bottom:40px;
background:rgba(0, 0, 0, 0.55);
border:none;
padding-left:20px;
font-family:Arial;
font-size:20px;
color:gray;
padding-top:20px;
padding-right:30px;
}
.mainArea .panel form .submit{
width:90px;
height:43px;
background:rgba(0, 0, 0, 0.55);
border:none;
font-family:Arial;
font-size:20px;
color:gray;
padding-top:-3px;
border-radius:10px;
margin-top:-5px;
margin-left:100px;
}
.mainArea .panel form .submit:hover{
cursor:pointer;
}
<html>
<head>
<meta charset="UTF-8">
<title>About</title>
<meta name="viewport" content="width=device-width, initial scale=1">
<link rel="stylesheet" href="contact.css">
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jquery/jqueryui.js"></script>
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="scripts/script.js"></script>
</head>
<body>
<div class="container">
<div class="mainHeader">
<nav>
<ul>
<li>Home</li>
<li>About</li>
<li><a class="active" href="#">Contact</a></li>
</ul>
</nav>
<img class="logo" src="logo.png">
</div>
<div class="mainArea">
<div class="panel">
<h1>Welcome to our contact page!</h1>
<form action="php/mail.php" method="POST">
<input type="text" value="Name" name="name" class="name"><br/>
<input type="text" value="Email" name="email" class="email"><br/>
<textarea name="message" class="body" rows="4" cols="50">What would you like to ask?</textarea><br/>
<input type="submit" value="Send!" class="submit">
</form>
</div>
</div>
</div>
</body>
</html>
And here is the background named background4.jpg Also, if you try to run the code snipet on this site it will get messed up because of the way stack overflow is laid out and because it needs the background image. So copying to a text file would work best.
if your elements get dispersed while zooming or re-sizing your browser window
use min-width and min-height for the containers
that will make them stay in the right way you like them
try to add this line :
.mainArea .panel {
min-width: 790px;
}
Unfortunately there isn't an universal way for browsers to zoom everything. At least not without a whole lot of scripting.
In my opinion it's also pretty weird to design a website and force browsers to 90%.
Zooming isn't what people do a lot (on desktop). Why not design a page at 100%?
I'm trying to create a site with the content in between two div columns labeled lwall and rwall , but I can't get my two side div's to show up. Why are they disappearing and how can I prevent this in the future?
<!DOCTYPE html>
<html>
<head>
<style>
body{
margin:auto;
background-color: maroon;
}
.head{
margin:auto;
text-align:center;
color:#00a2e8;
background-color:maroon;
width:750px;
}
.nav{
background-color:maroon;
width:750px;
margin:auto;
text-align:left;
}
.nav ul{
margin:auto;
padding:0px;
text-align:center;
}
.nav li{
display:inline;
list-style-type:none;
padding:20px;
}
.nav a{
display:inline;
background-color:maroon;
color:white;
text-decoration:none;
}
.nav a:hover{
display:inline;
color:#00a2e8;
text-decoration:none;
}
.content{
background-color:white;
margin:auto;
width:750px;
}
.content img{
width:200px;
height:250px;
}
.content ul{
text-align:center;
padding:20px;
}
.content ul li{
display:table-cell;
list-style:none;
}
.content ul li p{
padding:10px;
}
.lwall{
float:right;
background-color:blue;
height:50px;
width:50px;
background-repeat: repeat;
}
.rwall{
float:left;
background-color:blue;
height:50px;
width:50px;
background-repeat: repeat;
}
.foot{}
</style>
</head>
<body>
<div class="head">
<h1>Sea Aggie Brothers & Sisters</h1>
</div>
<div class="nav">
<hr>
<ul>
<li>Home</li>
<li>Services</li>
<li>Downloads</li>
<li>About</li>
<li>Calendar</li>
</ul>
<hr>
</div>
<div class="lWall">
</div>
<div class="rWall">
</div>
<div class="content">
<ul>
<li><div class="tbox">
<img src="Calendar.jpg" >
<h2>Calendar</h2>
<p>Check here to moniter meetings and other events. Additionally this calendar can be synchronized with other calendar programs.</p>
</div></li>
<li><div class="tbox">
<img src="Calendar.jpg" >
<h2>Resources</h2>
<p>When you join BASS you not only benafit from a strong community but also from our club resources such as our class notes & study guide database.</p>
</div></li>
<li><div class="tbox">
<img src="Contact.jpg" >
<h2>Newsfeed</h2>
<p>Catch up on the latest club news. Check here for anouncments and details on recent club events. This feed is also availible on facebook.</p>
</div></li>
</ul>
</div>
</body>
</html>
Simple. CSS declaration name is wrong. It should be .lWall and .rWall not .lwall and rwall. HTML tags are Case insensitive. But Custom CSS names are Case sensitive.
.lWall{
float:right;
background-color:blue;
height:50px;
width:50px;
background-repeat: repeat;
}
.rWall{
float:left;
background-color:blue;
height:50px;
width:50px;
background-repeat: repeat;
}
Or Change your HTML code like below.
<div class="lwall">
</div>
<div class="rwall">
</div>
DEMO
You just need to fix two things in your css, .lWall (insertspace) then {...} and for .rWall (insert space){..}
I am creating my own personal website as a test for what I have learned so far in HTML and JavaScript. I made the toolbar, and it looks nice on my monitor, which has quite a large width. I have the toolbar contents to be in the center. I tried accessing it on a smaller monitor, and the elements in the toolbar overlapped each other because I set the contents based on percentages. I know that measuring with pixels will come up with the same problem. How would I create a website where if the monitor width is larger than x pixels, then it will center the contents of the toolbar, but if the monitor width is smaller than x pixels, it will not center the contents of the toolbar?
As you can see in this jsFiddle, the elements overlap, but if you drag the view pane wider, you can see that it centers.
index.html:
<body>
<div id="header">
<div id="toolbar">
<div id="links">
<ol>
<li id="home">Home</li>
<li id="blog">Blog</li>
<li id="forum">Forums</li>
<li id="chatbox">Chatbox</li>
<li id="code">Code</li>
<li id="calendar">Calendar</li>
</ol>
</div>
<div id="login">
Username: <input type="text" name="firstname"></input>
Password: <input type="text" name="lastname"></input>
<button id="submit" class="button">Submit</button>
</div>
</div>
</div>
CSS:
body{
background-color:#EBF2F0;
margin-top:50px;
}
#links{
padding:0px;
margin:0px;
top:-10px;
position:absolute;
vertical-align: center;
}
a:link{
text-decoration:none;
color:#FFFF00;
}
a:visited{
text-decoration:none;
color:#FFFF00;
}
a:hover{
text-decoration:none;
color:#000BF2;
}
a:active{
text-decoration:none;
color:#FFFF00;
}
li{
display:inline;
padding:0px;
font-family:Courier;
}
ol{
list-style-type: none;
}
#header{
width:100%;
padding:5px 10px;
margin:0px;
height:25px;
top:0px;
left:0px;
position:fixed;
background-color:#000000;
}
#toolbar{
width:70%;
margin-left:15%;
margin-right:15%;
}
#home,#blog,#forum,#chatbox,#code,#calendar{
padding:10px;
color:#000BF2;
}
#home:hover,#blog:hover,#forum:hover,#chatbox:hover,#code:hover,#calendar:hover{
background-color:#2E2E2D;
color:#000BF2;
}
#login{
color:#FFFFFF;
margin-right:30px;
text-align:right;
}
#submit{
margin-top:-7px;
margin-left:10px;
padding:6px;
}
If you need a CSS only solution you could play with min-width:
#toolbar{
width:70%;
margin-left:15%;
margin-right:15%;
min-width:1200px;
}
Fiddle
This you can find a Fiddle example, and here is the code :
<div class="menu-alto">
<ul>
<li>
<a title="Link" href="#">Link</a>
</li>
<li class="newsletter">
<a title="Newsletter" href="#">Newsletter</a>
</li>
<li class="last">
<label style="color:#99cc00">cerca </label>
<input type="text" style="width:116px;" />
<input type="submit" style="width:40px;" class="bottone" value="VAI" />
</li>
</ul>
</div>
.menu-alto ul
{
list-style:none;
padding:0;
margin:0;
border:0;
}
.menu-alto li
{
display:block;
float:left;
font-family:Arial;
text-transform:uppercase;
color:#7c7c7c;
font-size:10px;
padding-right:16px;
}
.menu-alto li a:link,
.menu-alto li a:visited
{
color:#7c7c7c;
text-decoration:none;
letter-spacing:1px;
}
.menu-alto li a:hover
{
text-decoration:underline;
}
.menu-alto .last
{
padding-left:5px;
position:relative;
top:-5px;
}
.menu-alto .bottone
{
position:relative;
top:2px;
height:21px;
font-size:11px;
}
As you can see (just on IE7) the label with the text CERCA is not align (as middle) with the other links, and on Chrome (for example) the button is in the botton of the vertical-middle align. How can I fix this?
You should vertically center using vertical-align:middle; on all your <li> children instead of using relative position.
I'd like to implement bar where main menu is on the left and searchbox is on the right. My codes are:
<div id="divMenu">
<div id="menu">
<ul>
<li><span>Home</span></li>
<li><span>About Us</span></li>
<li><span>Events/Services</span>
<ul>
<li><span>submenu1</span></li>
<li><span>submenu2</span></li>
<li><span>submenu3</span></li>
</ul>
</li>
<li><span>Ventures</span></li>
<li><span>Testimonials</span></li>
<li><span>Resources</span></li>
<li><span>e-Commerce</span></li>
<li><span>Contact Us</span></li>
</ul>
</div>
<div id="search">
<!--<form id="fmSearch" name="fmSearch" method="post" action="">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="iSearch" type="text" id="iSearch" value="Search..." size="20" maxlength="100" /></td>
<td><input id="bSearch" name="bSearch" type="image" src="images/search.gif" class="button" /></td>
</tr>
</table>
</form>-->
<form id="fmSearch" name="fmSearch" method="post" action="">
<label><span>
<input id="iSearch" name="iSearch" type="text" class="keywords" maxlength="50" value="Search..." />
</span>
<input name="b" type="image" src="images/search.gif" class="button" />
</label>
</form>
</div>
</div>
CSS style are:
#divMenu { width:100%; height:30px; background-image:url(../images/bar_menu.jpg); background-repeat:repeat-x; margin:0; padding:0; border-top:1px solid #999;}
#menu { width:75%; margin:0; padding:0; height:30px; position:absolute;}
#menu ul {float:left; margin:0; padding:0; list-style:none; font-size:0.8em;}
#menu ul li {float:left; margin:0; padding:0;}
#menu ul li a {line-height:25px; display: block; color:#fff; padding:2px 10px; text-decoration:none; z-index:500;}
#menu a:hover, #menu ul li a.active {margin:0; /*background-image: url(../images/img_nav.jpg);*/ background-color:#1D1D1D; background-repeat:repeat-x; z-index:510; color:#999;}
#menu ul li ul {display:none; position:absolute; background-color:#333; z-index:520; font-size:1em;}
#menu ul li:hover ul {display:block; z-index:530;}
#search { width:25%; padding:0; margin:0; float:right; height:30px; z-index:999;}
#search form #iSearch { height:16px; z-index:1000;}
PROBLEM: My searchbox is not working. It is displayed on page but cannot click on it and type in it as if it's being hidden under something.
Any suggestions?
It's working fine here
http://jsfiddle.net/XFse7/
Must be some CSS before that causing the problem. I think it's under your menu if it's not working on your side. And note that z-index only works with positioned tag
position: absolute, relative, fixed, etc...