I can't figure out what is going on here, perhaps it's just too early!!
See this FIDDLE
When clicking on the links below the grey box, it will eventually scroll the relative content from right to left etc. However, when clicking items 2 & 3 in the nav, transport or scholarships, the navigation menu seems to move to the left or disappears completely! If someone could cast an eye, and correct my stupidity it'd be gratefully appreciated!
HTML:
<div class="finance-galleryWrapper">
<div class="galleryView">
<div class="swapView">
<li class="gallery-item" id="Fees"></li>
<li class="gallery-item" id="Transport"></li>
<li class="gallery-item" id="Scholarships"></li>
</div>
<nav class="toggle-nav">
<ul>
<li>Fees</li>
<li>Transport</li>
<li>Scholarships</li>
</ul>
</nav>
</div>
</div>
CSS:
/* --- Galleries --- */
.finance-galleryWrapper {
width: 860px;
height: 559px;
margin: 0 40px;
overflow: scroll;
}
.galleryView {
width: 860px;
overflow: hidden;
display: block;
}
.swapView {
width: 2580px;
height: 427px;
background: #666;
overflow: scroll;
}
li.gallery-item {
width: 860px;
height: 427px;
display: inline;
float: left;
}
/* toggle-nav */
/* toggle-nav */
.toggle-nav {
width:720px;
margin:50px auto 30px;
text-align:center;
position:relative;
z-index:1001;
}
.toggle-nav ul {
margin:0 auto;
}
.toggle-nav li, .toggle-nav li a {
display:-moz-table-cell;
display:inline-block;
*display:inline;
*zoom:1;
}
.toggle-nav li {
width:168px;
}
.toggle-nav li a {
width:171px;
margin:0 auto;
padding:6px 0 7px;
border:1px solid #cfcfcf;
font-family:Open Sans;
font-size:16px;
color:#666;
text-align:center;
text-decoration:none;
background-color:#fff;
}
.toggle-nav li a:hover {
color:#08c;
}
.toggle-nav li a:first-child {
border-left:1px solid #cfcfcf;
}
.toggle-nav li:first-child a {
border-radius:6px 0 0 6px;
box-shadow:none;
}
.toggle-nav li:last-child a {
border-radius:0 6px 6px 0;
}
.toggle-nav li a.active {
position:relative;
cursor:default;
text-decoration:none;
border:1px solid #2284d1;
color:#fff;
background-color:#59b1f6;
}
There you go it works now, however themenu looks different as I was working on it. Change it back again. Your code was very messy and was calling the same ids and classes so many times , i bet your html page was confused as hell and ya like the guy below said that you forgot to put proper position types. Your main one should have had position:absolute. You also missed out on proper display types like display:block
/* --- Galleries --- */
.finance-galleryWrapper {
width: 860px;
height: 559px;
margin: 0 40px;
overflow: scroll;
}
.galleryView {
width: 860px;
overflow: hidden;
display: block;
}
.swapView {
width: 2580px;
height: 427px;
background: #666;
overflow: scroll;
}
li.gallery-item {
width: 860px;
height: 427px;
display: inline;
float: left;
}
/* toggle-nav */
/* toggle-nav */
.toggle-nav {
width:720px;
margin:50px auto 30px;
text-align:center;
position:relative;
z-index:999;
display:block;
position:absolute;
}
.toggle-nav ul {
margin:auto;
display:block;
position:relative;
padding:0px;
}
.toggle-nav li {
display:inline-block;
position:relative;
margin:0px auto;
padding:0px;
}
.toggle-nav a {
width:171px;
margin:0 auto;
padding:6px 0 7px;
border:1px solid #cfcfcf;
font-family:Open Sans;
font-size:16px;
color:#666;
text-align:center;
text-decoration:none;
background-color:#fff;
}
.toggle-nav li a:hover {
color:#08c;
}
.toggle-nav li a:first-child {
border-left:1px solid #cfcfcf;
}
.toggle-nav li:first-child a {
border-radius:6px 0 0 6px;
box-shadow:none;
}
.toggle-nav li:last-child a {
border-radius:0 6px 6px 0;
}
.toggle-nav li a.active {
position:relative;
text-decoration:none;
border:1px solid #2284d1;
color:#fff;
background-color:#59b1f6;
}
Related
I am using #media all and (max-width: 600px) {} in my css for responsive menu, the thing is that it does not show correctly.
I want the orange fill the green space.. and turn the green space to transparant of course. Basically it's just a size/position problem.
CSS:
#media all and (max-width: 600px) {
.example-header .container {
width: auto;
height:auto;
margin:0 auto;
padding:auto;
}
/*Zwarte MENU balk */
a.menu-link {
display: block;
color: #fff;
background-color: #333;
text-decoration: none;
padding: 19px 10px;
width:auto;
height:auto;
margin:0 auto;
padding:auto;
margin-bottom:2em;
}
.menu {
border-top: 10px solid #333;
border-bottom:10px solid #333;
height:13.2em;
margin:0 auto;
padding:auto;
width:100%;
background-color:blue;
}
.menu ul {
width:auto;
height:auto;
margin:0 auto;
padding:auto;
}
.menu > ul {
height:auto;
margin-top:;
background-color:TRANSPARANT;
}
.menu li, .menu > ul > li {
width:100%;
height:auto;
margin:0 auto;
padding:0px;
background-color:green;
}
.menu li a {
color: #000;
display: inline;
border-bottom: 1px solid #333;
position: relative;
height:auto;
margin:0 auto;
padding:auto;
background-color:orange;
}
}
It looks like a padding-related issue, try setting it to 0 instead of auto for .menu ul. HTML would be helpful though.
My guess is that the anchor elements' should be display: block; instead of display: inline;. And possibly their margin should also be just 0 instead of 0 auto
Can't say much without the HTML.
Recently, I made a blog on blogger but I found a problem with the Css stylesheet.
when I put this Css stylesheet inside b:skin tag:
#import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:400);
#import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:700);
a img {border: none;}
a, a:visited{ color:#1E6FE0; text-decoration:underline; }
a:hover{ color:#FC7F01; text-decoration:underline; }
/****** header area *******/
.header_container {background:transparent !important;}
.header_nav { float:left; list-style-type:none; width:744px; height:31px; margin:36px 0 0 0; padding:0; background-image:url('http://www.example.com/short_navbar.png'); background-repeat:no-repeat !important;}
.header_nav div { margin:0 5px 0 5px; }
.header_nav li { float:left; }
.header_nav a { display:block; color:white; text-decoration:none; font-size:12px; line-height:30px; padding:0 7px 0 7px; font-weight:bold; text-shadow:0 2px 2px rgba(0, 0, 0, 0.3); font-family:Arial,Verdana,Helvetica,sans-serif;}
.header_nav_seleced, .header_nav a:hover { background-image:url('http://www.example.com/ttr-sprites.png'); background-repeat:repeat-x !important; padding-bottom:11px; background-position:0 -25px; }
.header_nav li { position:relative; }
.header_nav li ul { display:none; position:absolute; top:30px; left:0; padding:0; }
.header_nav li ul li { list-style:none; }
.header_nav li ul a { display:block; text-decoration:none; width:78px; background:#b95806; border-bottom:1px solid black; }
.header_nav li ul a:hover { display:block; text-decoration:none; background:#e8b866; background-image:none; min-width:56px; padding:0 7px 0 7px; }
.header_nav li:hover ul { display:block; }
.header_search_form { top:3px; left:-270px; }
.header_search_form_js { position:absolute; left: -272px; display:none; }
.header_search_form .search_bar { background-image:none; background-color:#fff; border: 1px solid #333; color:#333; font-size:12px; width: 308px; height:17px; padding:4px; -moz-border-radius: 3px; border-radius: 3px; }
.header_search_form #q { margin:0; }
.header_mousetrack { color:white; font-size:11px; font-weight:bold; margin:7px 0 11px 14px; float:left; }
.header_mousetrack a, .header_mousetrack a:visited { color:white; }
.new_portal_footer a, .new_portal_footer:visited, .new_portal_footer a:hover
.header_mousetrack a:hover { color:white; text-decoration:none; }
.header_top_ad { margin:0 0 0 0; }
.header_logo { float:left; margin:0 0 0 5px; _margin:0 0 0 0; }
.top_container {background: transparent !important; width: 988px !important; }
.header_nav_bar {display:inline;}
.ad5_container { background-image:url('http://www.example.com/black_border-2.png'); background-repeat:no-repeat !important; padding: 15px 0 0 15px; margin: 0 0 -30px -15px; height:330px; width:330px; _height:300px; _width:300px; _background:none;}
/* New header 2013 */
.hdr_top_left { width: 254px; padding-top: 18px; float: left; text-align: left; }
.hdr_nav_bar { position: relative; }
.hdr_nav_selected, .hdr_nav a:hover { background: #338CD8; }
.hdr_mag_outer { display: inline-block; margin-top: 4px; }
.hdr_search_form { position: absolute; top: 60px; right: 10px; display: none; .margin-top: -55px; }
.hdr_search_bar { border-radius: 8px; float: left; height: 24px; margin-top: 5px; width: 320px; background: transparent url(http://www.example.com/ttr_new_search_2.jpg) no-repeat scroll 0 0; }
.hdr_search_bar input { border: none; margin: 3px 5px 0; width: 305px; }
.hdr_search_bar input:focus { outline-width: 0; }
.hdr_top_ad { margin-top: 20px; }
.hdr_nav_outer { display: table; border: 0; margin: 18px 0 0 12px; min-width: 718px; background-color: #282828; float: left; }
.hdr_nav { display: table-row; overflow: hidden; margin: 0; padding: 0; min-width: 718px; list-style-type: none; }
.hdr_nav li.hdr_search_box { line-height: 1; vertical-align: top; }
.hdr_nav .hdr_search_box a { padding-top: 9px; padding-bottom: 16px; }
.hdr_nav li:hover { background: #338CD8; }
.hdr_nav li { line-height: 42px; display: table-cell; border: 0; margin: 0; padding: 0; vertical-align: middle; text-align: center; .float: left; }
.hdr_nav li, .hdr_nav2 li a { padding-bottom: 0; }
.hdr_nav li a, .hdr_nav li2 a:visited { padding: 0 7px; white-space: nowrap; color: white; display: inline-block; font-weight: normal; text-decoration: none; font-family: 'Roboto Condensed', arial, helvetica, sans-serif; font-size: 15px; text-shadow: none; .padding: 0 10px; }
.hdr_nav .hdr_search_box img { display: inline-block; width: 15px; height: 15px; margin-top: 4px; background: transparent url(http://www.example.com/mag-glass-dark.gif) no-repeat scroll center 0; }
.sprite{ width:170px;height:56px; background:url(http://www.example.com/ttr-sprites.png);}
.checkmark{width:17px;height:12px;background-position:0 0; margin-left:auto;margin-right:auto;}
.star_full_blue{ width:13px;height:14px; background-position:-18px 0px; float:left;}
.star_half_blue{ width:13px;height:14px; background-position:-31px 0px; float:left;}
.star_empty_blue{ width:13px;height:14px; background-position:-45px 0px; float:left;}
.star_full_gold{ width:13px;height:14px; background-position:-60px 0px; float:left;}
.star_half_gold{ width:13px;height:14px; background-position:-74px 0px; float:left;}
.star_empty_gold{ width:13px;height:14px; background-position:-87px 0px; float:left;}
.magnify_glass{ width:16px;height:18px; background-position:-101px 0px;}
.mailing_list_submit_button{width:60px;height:25px;background-position:-117px 0px;}
.tan_bar{width:32px;height:32px; background-position:-114px 32px;}
.right_ad_scroller {width: 300px; margin: 10px;}
/****** footer area *******/
.footer{ width:917px; float:left; padding:30px 30px 30px 30px; background-color:#000; color:#ccc; margin:0 0 0 2px; overflow:hidden;}
.footer a.footer-links{ text-align:left; display:block; float:left; width:160px; color:#ccc; text-decoration:none; line-height:30px; font-weight:100; border-top-style:solid; border-top-color:#474747; border-top-width:thin; }
.footer a.footer-links:hover{ color:#fff; }
.footer-headers{ font-size:20px; display:block; float:left; color:#fff; text-decoration:none; line-height:50px; font-weight:lighter; letter-spacing:0.05em; }
.footer-lcolumn{ font-size:14px; letter-spacing:0px; width:160px; margin:0 30px 0 0; float:left; }
.footer-rcolumn{ font-size:14px; letter-spacing:0px; width:300px; float:right; }
.footer-bar{ display:block; width:300px; .width:303px; margin:0 0 20px 0; float:right; font-size:12px; }
.footer .newsletter-input{ display:block; font-size:16px; color:#999; width:212px; height:28px; line-height:18px; float:left; padding:0 5px 0 5px; margin:0 2px 0 0; border:none; }
.footer a.footer-button:hover{ opacity:0.9; }
.footer-button:hover{ opacity:0.9; }
footer { clear:both; text-align: center; }
.new_portal_footer ul {
list-style-type: none;
margin-bottom: 10px;
margin-top: 10px;
padding-left: 0px;
font-size: 8px;
}
.new_portal_footer {
background-color: white;
color: white;
font-size: 10px;
}
.popcontentrow {
width: 100%;
clear: both;
float: left;
background-color: #FFFFFF;
}
#popcontent {
position: absolute;
border: 0px;
display: none;
background-color: #FFFFFF;
z-index: 501;
}
.new_portal_footer img { margin-top:0 !important; }
.site-tools { margin:35px auto 40px; padding:10px 0; width:68%; text-align:center; border-top:2px solid #ccc; border-bottom:2px solid #ccc; clear:both; }
.site-tools a { margin:0 15px; padding:0; position:relative; width:80px; height:75px; overflow: hidden; display: inline-block; opacity:1; -webkit-transition: opacity 0.3s ease-in-out; -moz-transition: opacity 0.3s ease-in-out; -o-transition: opacity 0.3s ease-in-out; transition: opacity 0.3s ease-in-out; }
.site-tools a:hover { opacity:.6; }
.site-tools img { position: relative; }
.site-tools img.newsletter { }
.site-tools img.staff-index { top:-72px; }
.site-tools img.mobile { top:-152px; }
.site-tools img.contact-us { top:-222px; }
.site-index { color:#fff; background:#000; .display:block !important; }
.footer-wrap { margin:0 auto; padding:70px 0; width:974px; text-align: left; background:#000; }
.footer-toggle { clear: both; background:#fff; text-align: center; border-bottom:1px solid #000; line-height:20px; }
.footer-toggle span { padding:8px 39px 4px 34px; background:#000 url('http://www.example.com/sprite-footer-icons.gif') no-repeat -190px 13px; font-size:1.6em; cursor:pointer; }
.links { margin:0 15px 0 15px; float:left; width:165px; }
.links li { font-size:1.6em; line-height:36px; border-top:1px solid #333; }
.links li a:hover { text-decoration: underline; }
.links li.title, .nl-signup .title { margin-bottom:20px; position:relative; border-top:none; height:28px; width:188px; overflow: hidden; line-height:48px; }
.nl-signup .title { width:224px; }
li.title img, img.join { position:relative; }
li.title img.company { top:0; }
li.title img.network { top :-42px; }
li.title img.footer-categories { top: -82px; }
li.title img.follow-us { top: -122px;}
.title img.join { top: -166px; }
.clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
.footer-tools { margin:10px 0 0 70px; float:left; width:318px; }
.footer-tools .links { margin:0 0 60px; width:318px; }
.footer-tools .links li { border-top:none; float:left; }
.footer-tools .links li.title { float:none; }
.footer-tools li a.rss, .footer-tools li a.fbook, .footer-tools li a.gplus, .footer-tools li a.twitter, .footer-tools li a.youtube { margin-right:20px; width:43px; height:40px; position:relative; overflow:hidden; float:left; }
.footer-tools li a.youtube { margin-right:none; }
.footer-tools li a img { position: relative; top:-207px; opacity:1; -webkit-transition: opacity 0.3s ease-in-out; -moz-transition: opacity 0.3s ease-in-out; -o-transition: opacity 0.3s ease-in-out; transition: opacity 0.3s ease-in-out; }
.footer-tools li a:hover img { opacity: .6; }
.footer-tools a.rss img { left:0; }
.footer-tools a.fbook img { left:-65px; }
.footer-tools a.gplus img { left:-135px; }
.footer-tools a.twitter img { left:-197px; }
.footer-tools a.youtube img { left:-264px; }
/******** body area **********/
body { background-image: url('http://www.example.com/black-to-gray-bg.png'); background-position: left top; background-repeat: repeat-x; background-color: #737573 !important; margin: 0;}
.main_page_left, .main_page_right {display:none;}
.main_page_left {background-color:transparent; background-image:none !important;}
.main_page_right {background-color:transparent; background-image:none !important;}
.portal_body {width: 1000px; margin: auto; font-family: Arial, Verdana, Helvetica, sans-serif;}
/*.sponsored_ads {display:none;}*/
.t1_nav_bar { background-image: url('http://www.example.com/matrix-header.gif') !important; background-position: 8px top; background-repeat: no-repeat; background-color: transparent; height: 48px; color: white; text-shadow: rgba(0, 0, 0, 0.3) 0 2px 2px; padding: 0 10px !important; width: 981px; }
.bottom_next_page_cont { width: 953px !important; margin-left: 9px; display: inline; }
.middle_page_inner_container { width: 953px !important; margin-left: 9px; display: inline; background-color: white; }
td.t1_left_cell_10 { width: 152px !important; }
.rank_row_last_col { }
.new_review_header { width: 937px !important; }
.ttr_top_left { width:240px; padding-left: 0px !important; padding-right: 0px !important;}
#contents { position:absolute; width:auto; top:600px; left:200px; }
/* right nav */
#ad_4 { float:none; text-align:center; padding:0; margin:0; }
#ad_5 { padding:0; margin:0; border:none; }
.top_ten_products { width:300px; min-height:85px; overflow:hidden; border:1px solid #CCC; }
.top_ten_products_header { background-image:url('http://www.example.com/top_ten_grad.png'); width:300px; height:37px; border-bottom:1px solid #CCC; }
.top_ten_products_header_title { float:left; font-size:18px; margin:6px 0 0 9px; }
.top_ten_products_header_all { float:right; margin:11px 14px 0 0; }
.top_ten_products_body { width:300px; max-height:212px; overflow:auto; }
.top_ten_products_row { float:left; border-bottom:1px solid #CCC; width:275px; padding:2px 0 2px 0;}
.top_ten_products_img { float:left; width:43px; height:36px; margin:0 5px 0 5px; text-align:center; }
.top_ten_products_img img { max-width:43px; max-height:34px; margin:1px 0 1px 0; }
.top_ten_products_rank { float:left; font-size:13px; margin: 12px 5px 0 0; }
.top_ten_products_name { float:left; font-size:12px; margin:13px 0 0 3px; width:200px;}
my blogger page becomes messy. but when I leave the b:skin empty and call the css stylesheet using an external url:
<link rel="stylesheet" type="text/css" href="http://www.example.com/stylesheet.css" media="all" />
The page is organized and works elegantly on Chrome .. messy a bit on firefox.
Please, tell me what wrong with the css code that I use.
My navigation bar works perfectly fine, any image links work fine, but all text links on my page jump down when I click on them. Most of them jump so far you cannot actually click it.
I also noticed my a:visited links are inheriting the color #000 from somewhere, when they should be #616161. There is no issue when browsing on my Android device, but happens in IE11 and Chrome32.
The HTML is nothing special. Just
Page Name
type links. It has to be something with the CSS.
The CSS:
body {
background-color: #7296d9;
max-width:1000px;
}
#wrapper {
width:auto;
background:url(../images/bg.jpg);
background-repeat:repeat;
margin:4px;
}
#content {
width:98%;
text-align:center;
margin:auto;
}
#paragraph {
width:80%;
font-size:18px;
color: #666;
font-weight:100;
text-align:justify;
margin:10px auto 25px auto;
}
.reviews {
width:80%;
margin:auto;
text-align:justify;
color: #666;
}
p {
margin:10px 0 10px 0;
}
h1 {
line-height:48px;
font-size:36px;
font-weight:bold;
text-align:center;
margin-top:10px;
}
h2 {
line-height:42px;
font-size:24px;
font-weight:bold;
text-align:center;
}
a:link, a:visited {
color: #616161;
text-decoration: underline;
}
a:hover, a:active {
color: #ffffff;
text-decoration: underline;
}
#header {
height:86px;
max-height:86px;
width:98%;
min-width:500px;
position:relative;
background-image:url(../images/logo.png);
background-repeat:no-repeat;
}
#header .left {
float:left;
height:auto;
}
#header .media-header {
float:right;
margin-top:50px;
margin-right:-20px;
}
#menu ul li:hover > ul {
display: block;
}
#menu {
display:table;
width:100%;
background: -webkit-linear-gradient( #d5d5d5, #595959); /* For Safari */
background: -o-linear-gradient( #d5d5d5, #595959); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient( #d5d5d5, #595959); /* For Firefox 3.6 to 15 */
background: linear-gradient( #d5d5d5, #595959); /* Standard syntax */
-webkit-border-radius: 25px;
-o-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
}
#menu ul ul {
display: none;
}
#menu ul {
height:auto;
font-size: 16px;
font-family: "Times New Roman", Times, serif;
font-weight: bold;
text-align: center;
text-shadow: 2px 2px 2px #cccccc;
text-decoration:none;
list-style: none;
position: relative;
display: table-row;
}
#menu a:link, a:visited {
display:block;
text-decoration: none;
color: #000000;
padding: 8px auto 8px auto;
}
#menu a:hover, a:active {
display:block;
padding:5px;
text-decoration:none;
color: #fff;
}
#menu ul:after {
content: "";
clear:both;
display: block;
}
#menu ul li {
display:table-cell;
width:auto;
}
#menu ul a:link, a:visited {
display: block;
padding: 5px;
color: #000;
text-decoration: none;
}
#menu ul a:hover, a:active {
display:block;
padding:5px;
text-decoration:none;
color: #fff;
}
#menu ul ul {
background: #999;
border-radius: 0px;
padding: 0;
position: absolute;
}
#menu ul ul li {
width:auto;
border-top: 1px solid #ccc;
position: relative;
display:block;
}
#menu ul ul li a {
padding: 5px;
text-align:left;
color: #000;
}
#menu ul ul li a:hover {
color: #FFF;
}
#menu ul ul:last-child, nav ul ul:last-child a {
-webkit-border-bottom-right-radius: 10px;
-o-border-bottom-right-radius: 10px;
-moz-border-radius-bottomright: 10px;
border-bottom-right-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-o-border-bottom-left-radius: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-left-radius: 10px;
}
.center {
text-align:center;
}
#reviews {
width:80%;
text-align:justify;
overflow:hidden;
margin:25px auto 25px auto;
}
#reviews img {
position:relative;
float:left;
}
#form {
color: #666;
margin:0px auto 0px auto;
width:350px;
}
#form p {
color: #666;
margin:0px auto 0px auto;
width:350px;
}
.bottombar {
margin:auto;
width:100%;
}
#footer {
display:block;
font-size:12px;
color: #616161;
text-align:center;
width:auto;
margin:5px auto 5px auto;
}
#footer img {
text-align:center;
color: #616161;
width:100%;
margin:5px auto 5px auto;
}
#media-footer {
text-align:center;
margin:10px 0 15px 55px;
}
#media-footer img {
text-align:center;
margin:10px 0 15px 55px;
}
nav ul {
display:none;
}
#minimenu {
display:none;
}
It's because you are adding padding to the element when it is :active:
#menu ul a:hover, a:active {
display: block;
padding: 5px;
text-decoration: none;
color: #fff;
}
It's worth noting that you are repeating the same styling in different instances.
#menu a:hover, a:active {
display: block;
padding: 5px;
text-decoration: none;
color: #fff;
}
Just remove the padding from both declarations and it will work as expected.
I have some pictures with links, and in IE, there is a blue border around them, I have tried everything I have found, this link as well. how to remove blue border around links in IE9?
For some reason I cannot get it to go away.
Thanks in advance for the help.
Its the div.logo one I am trying to fix
body {background-image:url('../images/space1.jpg');
background-repeat: no-repeat center center;
background-position: center;
background-size: cover;
width: 100%;
min-height: 100%;
}
body {color:white;}
a, a:visited {
color:#3399FF; text-decoration:none;}
div.header{
text-align:right;
font-size:200%;
}
div.header1 {
text-align:right;
font-size:125%;
}
div.logo{
margin-top:-40px;
a border:none;
img
text-decoration: none;
border: 0px;
border-style:none;
}
#nav{
width:85%;
height:3%;
font-size: 26px;
font-weight: bold;
border-radius: 8px;
text-align: center;
margin: 0 auto;
position:absolute;
top:100px;
left:120px;
}
#nav ul {
height: auto;
padding: 0px 0px;
margin: 0px;
background-color: #f2f2f2;
border-bottom: 1px solid #ccc;
display: inline-block;
}
#nav li {
display: inline-block;
padding: 20px;
margin-left: auto;
margin-right: auto;
}
#nav a {
text-decoration: none;
color: #3399FF;
padding: 8px 8px 8px 8px;
}
#nav a:hover {
color: #000000;
background-color:#3399FF;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
div.qui {
text-align:center;
font-size:200%;
text-decoration:underline;
}
div.specs {
text-align:center;
font-size:175%;
}
ul.qui {
text-align:center;
font-size:150%;
list-style-type: none;
}
.images {
overflow: hidden;
}
.images img {
float: left;
margin: 0px;
}
div.glams {
text-align: center;
}
.left {
float: left;
margin-left:20%;
padding:10px;
border:3px solid #585858 ;
}
.right {
float: right;
margin-right:20%;
padding:10px;
border:3px solid #585858 ;
}
p.v {
text-align:center;
}
#media only screen and (min-width: 768px) and (max-width: 770px)
and (orientation : portrait) {
div.header{
text-align:right;
font-size:140%;
}
div.header1 {
text-align:right;
font-size:100%;
}
div.logo{
margin-top:-40px;
}
div.logo
img {
height:100px;
width:200px;
}
#nav{
width:100%;
height:3%;
font-size: 100%;
font-weight: bold;
border-radius: 8px;
margin:0;
padding:0;
text-align: center;
margin-top:5%;
margin-left:-14%;
}
#nav ul {
height: auto;
padding: 0px 0px;
margin: 0;
background-color: #f2f2f2;
border-bottom: 1px solid #ccc;
display: inline-block;
}
#nav li {
display: inline
padding: 5px;
margin-left: auto;
margin-right: auto;
}
#nav a {
text-decoration: none;
color:#3399FF;
padding: 8px 8px 8px 8px;
display: inline-block;
}
#nav a:hover {
color: #000000;
background-color: #FFF;
}
li:hover ul {
display: block;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
div.qui {
text-align:center;
font-size:200%;
text-decoration:underline;
margin-top:15%;
}
div.specs {
text-align:center;
font-size:175%;
}
ul.qui {
text-align:center;
font-size:150%;
list-style-type: none;
}
.images {
overflow: hidden;
}
.images img {
float: left;
margin: 0px;
}
div.one {
text-align: center;
}
.left {
float: left;
margin-left:3%;
padding:0px;
border:3px solid #585858 ;
}
.right {
float: right;
margin-right:3%;
padding:0px;
border:3px solid #585858 ;
}
p.v {
text-align:center;
}
div.glams
img {
height:180px;
width: 300px;
}
#media only screen
and (min-device-height : 768px)
and (min-device-width : 1024px)
and (orientation : landscape) {
body { background: green; }
div.header{
text-align:right;
font-size:140%;
}
div.header1 {
text-align:right;
font-size:100%;
}
div.logo{
margin-top:-40px;
}
div.logo
img {
height:80px;
width:150px;
}
#nav{
width:100%;
height:3%;
font-size: 100%;
font-weight: bold;
border-radius: 8px;
margin:0;
padding:0;
text-align: center;
margin-top:5%;
margin-left:-14%;
}
#nav ul {
height: auto;
padding: 0px 0px;
margin: 0;
background-color: #f2f2f2;
border-bottom: 1px solid #ccc;
display: inline-block;
}
#nav li {
display: inline
padding: 5px;
margin-left: auto;
margin-right: auto;
}
#nav a {
text-decoration: none;
color:#3399FF;
padding: 8px 8px 8px 8px;
display: inline-block;
}
#nav a:hover {
color: #000000;
background-color: #FFF;
}
li:hover ul {
display: block;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
div.qui {
text-align:center;
font-size:200%;
text-decoration:underline;
margin-top:15%;
}
div.specs {
text-align:center;
font-size:175%;
}
ul.qui {
text-align:center;
font-size:150%;
list-style-type: none;
}
.images {
overflow: hidden;
}
.images img {
float: left;
margin: 0px;
}
div.one {
text-align: center;
}
.left {
float: left;
margin-left:3%;
padding:0px;
border:3px solid #585858 ;
}
.right {
float: right;
margin-right:3%;
padding:0px;
border:3px solid #585858 ;
}
p.v {
text-align:center;
}
div.glams
img {
height:180px;
width: 300px;
}
}
To make them go away use this:
a > img {
border: 0;
}
This means the image just inside the link should have no border. I had the same issue and its fixed! :) Try it.
a, div {
outline: none;
border: none;
}
outline means the blue border.
I am trying to scale a menu bar according to screen size. I've tried float, #media etc. but it hasn't worked properly. Full screen on my 13' looks great. However, as soon as I scale it down, the menu bar shifts to the right, but the page elements are fine. Menu is at the bottom #navsite.
CSS
* {
margin:0;
padding:0;
}
html{
min-width:770px;
}
body{
background:white url(candy/background.png) 0 0 repeat;
text-align:center;
}
/*=====[ Set up container divs and add background tiles ]=====*/
#pageheadContainer,
#contentContainer,
#footContainer{
width:100%;
}
#pageheadContainer{
background:transparent url(candy/pageheadBackground.png) 0 100% repeat-x;
}
#contentContainer{
background:#F7F7F7 url(candy/contentBackground2.png) 50% 100% repeat-y;
float:left;
}
#footContainer{
background:transparent url(candy/footBackground.png) 0 0 repeat-x;
clear:both;
}
#pagehead,
#content,
#foot{
width:770px;
margin:0 auto;
position:relative;
text-align:left;
}
#pagehead{
height:130px;
}
#foot{
height:150px;
}
#pagehead{
background:transparent url(candy/pageheadBackground2.png) 0 100% no-repeat;
}
#content{
background:transparent url(candy/contentBackground.png) 0 0 no-repeat;
min-height:300px;
_height:300px;
}
#foot{
background:transparent url(candy/footBackground2.png) 100% 0 repeat-x;
}
#article{
width:450px;
float:left;
padding:40px 0 20px 0;
margin-left:25px;
}
#subContent{
display:inline;
width:180px;
float:left;
padding:25px 0 20px 0;
margin-left:30px;
color:#8B725A;
font-size:.9em;
}
#foot ul{
position:absolute;
top:45px;
}
#foot li{
list-style-type:none;
}
#foot #foot1{
width:200px;
position:absolute;
left:300px;
}
#foot #foot2{
width:200px;
position:absolute;
left:570px;
}
#foot #pageTop{
position:absolute;
left:482px;
top:-40px;
}
#foot #pageTop a{
display:block;
width:26px;
height:26px;
text-indent:-9999px;
text-decoration:none;
background:transparent url(candy/pageTop.png) 0 0 no-repeat;
float:left;
}
body{
font:normal 62.5%/1.8em Arial, Helvetica, sans-serif;
}
#content ul{
margin:0.8em 0 0.6em 1em;
padding-left:1em;
list-style-type:square;
}
ol{
margin:0.8em 0 0.6em 2em;
padding-left:1em;
list-style-type:lower-roman;
}
blockquote{
margin:0.8em 0 0.6em 1em;
padding-left:1em;
font-style:italic;
border-left:4px solid #E2D7CF;
}
img{
padding:2px;
border:1px solid #F2F2F2;
}
#content{
font-size:1.25em;
}
p{
margin:0.3em 0 0.6em 0;
}
a{
color:#9D6141;
font-weight:bold;
text-decoration:none;
}
a:hover{
background:#9D6141;
color:#FFE;
}
#article{
line-height:1.7em;
color:#635141;
}
h1,
h2,
h3,
h4{
font-family:Georgia, Times New Roman, Times, serif;
}
h2{
color:#98533B;
margin-bottom:.5em;
line-height:1.7em;
font-size:1.7em;
}
h3{
margin:0.8em 0 0.6em 0;
font-size:1.3em;
}
h4{
margin:0.8em 0 0.6em 0;
font-size:1.1em;
}
#subContent h2{
font-size:1.3em;
}
#subContent h3{
font-size:1.1em;
}
/* menu navigation */
.navsite {width: 845px; height: 35px; z-index: 100;
margin-bottom: 3px; margin-left: 155px;}
/* menu bar */
#headermenu {width: 800px; height: 35px; z-index: 100; position: absolute}
#headermenu ul {
text-align: center;
list-style: none;
line-height: 20px;
font-size: small;
}
#headermenu a {
display: block;
width: 8em;
color: white;
text-decoration: none;
padding: 0.3em;
white-space: nowrap;
}
#headermenu li {
float: left;
padding: 0;
width: 8em;
background-color: #B67357; /* medium brown */
}
#headermenu li ul { /* second level lists */
position: absolute;
z-index:500;
left: -999em;
height: auto;
width: 8em;
border-width: 0.25em;
margin: 0;
}
#headermenu li:hover ul, #nav li.shfhover ul {
left: auto;
z-index:100;
}
#content {
clear: left;
color: #ccc;
}
#media screen and (max-width: 770px)
{
#headermenu {
width:770px;
margin:0 auto;
position:relative;
text-align:left;}
}
So your problem is you're absolutely positioning the menu from the left of the browser. So when you resize it it moves.
If you want the whole site to be centered but fluid you can use the following
width:100%; max-width:400px; margin:auto;
Here's a Fiddle