nav menu not functioning correctly - css

Ok, I'm working on this website (its my first one), and I am looking for some insight on making my nav menu work better. When you go to the "projects" page, the about button all of a sudden looks like it has too much spacing to the right. Also, when you go to the "Contact" page, the menu is totally messed up. I thought about just adding the home button to the main page navigation so all the menus would be exactly the same and maybe it would work right, but there HAS to be a better solution.
Also, the website looks really flat. I'd be open to suggestions on giving it some depth, as well as any other criticism you may have. (bear in mind I've only been doing this for a couple months).
Web address
HTML:
<ul class="transparent" id="navcontainer" >
<li class="topnavleft floatleft">Home</li>
<li class="topnav floatleft">About</li>
<li class="topnavright floatleft">Projects</li>
</ul>
CSS:
#navcontainer {
margin-top: 0;
height: 55px;
width: 232px;
float: right;
overflow: visible;
padding: 0;
}
.topnav {
width: 45px;
border-right: 1px solid #FFF;
margin-right: 10px;
padding-right: 22px;
margin-left: 10px;
margin-top: 16px;
}
.topnavleft {
width: 45px;
border-right: 1px solid #FFF;
border-left: 1px solid #FFF;
margin-left: 7px;
padding-left: 10px;
padding-right: 6px;
margin-top: 16px;
}
.topnavright {
width: 45px;
border-right: 1px solid #FFF;
margin-right: 7px;
padding-right: 20px;
padding-left: 1px;
margin-top: 16px;
}

There is a problem with this line in the About page:
<div class="transparent" id="logo"><img src="Images/ALR%20%20custom%20guitars2.png" alt="ALR Custom Guitars" width="250" border="0" </img>
You have missed out the closing /> of the img tag, it should be like this:
<div class="transparent" id="logo"><img src="Images/ALR%20%20custom%20guitars2.png" alt="ALR Custom Guitars" width="250" border="0" /></img>
For screenreaders and search engines, the logo should have the text ALR Custom Guitars, use a background-image instead of an img tag, and set text-indent: -999px so that only the image will show.
Also, lots of your links point to www.ALRGuitars.com, they should be http://www.ALRGuitars.com.
EDIT:
Here are some errors to correct (remember to correct all errors and warnings from the W3C validation result):
This:
<a href="http://www.facebook.com/pages/ALR-Guitars/301363959926689" target="_blank"><img src="Images/facebook_512.png" border="0" height="32px" width="32px" </img><a/>
<img src="Images/twitter_512.png" border="0" height="32px" width="32px"</img>
Should be:
<a href="http://www.facebook.com/pages/ALR-Guitars/301363959926689" target="_blank"><img src="Images/facebook_512.png" border="0" height="32px" width="32px" />
<img src="Images/twitter_512.png" border="0" height="32px" width="32px"</img>
In the copyright notice, you have forgotten a semicolon after a character reference.
Either use © or ©.
This:
<link href'http://fonts.googleapis.com/css?family=Over+the+Rainbow|Open+Sans:600,700italic' rel='stylesheet' type='text/css'/>
Should be:
<link href='http://fonts.googleapis.com/css?family=Over+the+Rainbow|Open+Sans:600,700italic' rel='stylesheet' type='text/css'/>
There was a missing = sign after href.
EDIT #2:
After some fiddling with the CSS, try this for the menu:
#navcontainer {
float: right;
width: 250px;
height: 30px;
padding: 5px;
margin-top: 0;
overflow: visible;
}
.topnav a {
display: block;
width: 70px;
height: 20px;
padding: 5px;
text-align: center;
}
a:hover {
color: #606060;
font-style: italic;
}
It should correct the problem of the links moving when hovered over.

the spacing is because you specified topnav width as 45...'projects' is too large and 'about' is too small..let it be automatic or try to align all the text into the middle so that it wont seem weird...

Related

Logo doesn't float left in header?

I am trying to float my logo to the left in the header but it doesn't float to left at all. I would really appreciate if someone could point our my error since I am new to CSS.
This is my website if you would like to see my problem live: http://cashski.com/
Here is my HTML code:
<div id="navigation">
<div class="center_navigation">
Contact
Instagram Followers
Instagram Photo Likes
<img src="img/logo.png" />
</div>
</div>
Here is my CSS code:
body {
padding: 0px;
margin: 0px;
font-family: Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif;
}
#navigation{
width: 100%;
height: 50px;
margin: 0px auto;
position: relative;
background-color: #2d5b89;
border-bottom: 1px solid #244a75;
}
.center_navigation {
width: 960px;
height: 50px;
margin:0px auto;
font-size: 16px;
}
.center_navigation a {
padding: 10px 0 10px 30px;
float: right;
margin-top: 4px;
color: #babcc5;
text-decoration: none;
}
.center_navigation a:hover {
color: white;
}
.center_navigation a img {
float: left;
}
The problem is your all anchor tags are float:right and your image is inside a anchor tag, so making img float:left doesn't change much.
So you either need to put the style on the container of image ie. anchor tag like this
<a href="index.php" style="float: left;">
<img src="img/logo.png">
</a>
or if your image is always in last anchor tag then you can also use this
.center_navigation a:last-child{
float: left;
}
Js Fiddle Demo

Issue placing div after facebook friends box

Every time I include the code for the facebook friends like box the div element box below it goes wacky. I cannot control where its positioned. It either disappears or overlaps a different div. Originally I just wanted specials, events, then fbFriends in a row then the box div below the three divs. I have been trying to wrap the divs to control everything better but am still unsuccessful. Any help would be appreciated
specials events fbFriends
box -------------------box
<div id="specialsWrapper">
<div id="specials" ><p>Featured Specials</p></div>
<div id="events" ><p>What's happening at the hub</p></div>
<div id="fbFriends">
<div class="fb-like-box"
data-href="https://www.facebook.com/pages/********"
data-height="395" data-width="250" data-show-faces="true"
data-colorscheme="dark" data-stream="false" data-header="true" />
</div>
</div>
</div>
<div id="box" ></div>
#specialsWrapper
{
height: 450px;
width: 920px;
color: white;
}
#specials {
float: left;
border:2px dashed white;
height:390px;
width: 270px;
color: white;
margin: 25px 10px 0px 48px;
}
#specials p {
margin: 0px;
padding: 15px;
text-transform:uppercase;
font-size: 24px;
font-style: oblique;
}
#events {
float: left;
border:2px dashed white;
height:390px;
width: 270px;
color: white;
margin: 25px 15px 15px 15px;
}
#events p {
margin: 0px;
padding: 15px;
text-transform:uppercase;
font-size: 24px;
font-style: oblique;
}
#fbFriends {
float: left;
margin: 25px 15px 15px 15px;
width: 250px;
height:390px;
}
#box
{
clear: left;
border: 2px dashed white;
height: 60px;
width: 853px;
color: white;
margin: 25px 15px 15px 48px;
}
Here's anwser for your question
EXAMPLE ON CODEPEN
Your build of these box's is weird thats why I had to use top: 40px; with position: relative;
btw. that's how you do on jsfiddle or codepen exampl, thats all community ask. Spend 5 min for your question isnt much to ask?
hope thats help.
EDIT:
I found what what the issue, you didnt closed specialsWrapper div thats why margin dint work.
I also cancel margin-botton from boxes inside specialWrapper and put overflow: auto to specialWrapper to countheight.
Now top: no need to be writen.
I think what you might want it display: inline-block; but without something to see I can't really know what's going on. And your description isn't enough. Could you post what's going on on js.fiddle.net or give us an example site?

popup issue - align center

I am trying to align my popup at the center of the page.
whichever image box i click, popup should appear in the center of the page without need to scroll up or down
Please help me to achieve it.
Test Link Site : http://www.scs-qa.com/panamera/trading.html
.white_content
{
-moz-border-radius: 5px 5px 5px 5px;
background-color: white;
border: 3px solid #000000;
display: none;
height: auto;
left: 30%;
overflow: auto;
padding: 16px;
position: absolute;
top: 10%;
width: 500px;
z-index: 1002;
border-radius: 15px 15px 15px 15px;
text-align: justify;
font-size: 10pt;
font-family: 'Tahoma' ;
}
HTML
<div class="trading-img-box">
<a href = "javascript:void(0)" onclick = "document.getElementById('trading1').style.display='block';document.getElementById('body-below-otherpage-small-trading').style.display='none'">
<img class="trading-img" src="img/trading1.png">
</a>
<h1 class="trading-h1">Furniture</h1>
<p style="height:0; clear:both;" class="trading-p">It 's pleasant to live spec..</p>
</div>
<div id="trading1" class="white_content">
<a style="float:right" href = "javascript:void(0)" onclick = "document.getElementById('trading1').style.display='none';document.getElementById('body-below-otherpage-small-trading').style.display='block'">Close</a>
<br/><br/>
<img src="img/tradingb1.png" style="margin-top: 5px; margin-left: 25px; margin-right: 5px"><br/><br/>
<strong>Furniture</strong>
<p>some text
</p><br/>
<p>some text
</p>
</div>
Try this:
.white_content {
left:50%;
margin-left:-250px;
}
If you need a solution independent of the size of the div, then you need to use javascript or jquery.
http://jsfiddle.net/DerekL/GbDw9/

Combining :hover and :nth-child(n4+4)?

I'm stuck and can't figure out a fix to my current problem and was hoping to get some help and/or direction.
I was wondering if there is a way to combine the :hover and :nth-child(4n+4) pseudo classes. If you visit my sandbox page there is an un-ordered list (the deal polaroids) where I have every 4th list item display a zero margin. The problem is that the :hover adds a 10px padding that breaks the flow on every 4th list item. I can't seem to figure out how to prevent the flicker that is caused by hovering over those list items. I tried combining things to no avail and using "!important" (which I try and avoid). Can anyone help? I that I'm overlooking something and a second pair of eyes would help.
here is the CSS/HTML:
CSS:
ul#myTiks li {
float: left;
width: 230px;
display: block;
margin-right: 35px;
list-style-type: none;
margin-bottom: 35px;
color: #333;
}
ul#myTiks li:hover {
padding: 10px;
background-image: url(../img/dwt/white_bgd_30.png);
margin: -10px 25px 25px -10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
ul#myTiks li:nth-child(4n+4) {
margin-right: 0 !important;
}
HTML:
<li>
<div class="polaroid">
<div class="title">Title Of Deal</div>
<div class="category">Deal Category</div>
<div class="tik"></div>
<div class="img"><img src="../img/dwt/myTik_placeholder_img.png" width="197" height="197"></div>
<div class="soc" style="display:none;">
<img src="../img/dwt/tweet_btn_x20h.png" width="55" height="20">
<img src="../img/dwt/fb_like_btn_x20h.png" width="46" height="20">
<img src="../img/dwt/pin_btn_x20h.png" width="55" height="20">
</div>
</div>
</li>
Just change your right margin to -10px, no need for important:
ul#myTiks li:nth-child(4n+4) {
margin-right: -10px;
}

Add rounded corner mask to icon using $linkImg variable

Not as savvy on this as I'd like to be, so forgive me if my question is not phrased correctly.
Need to apply four rounded corners to a 119 x 119 App Store icon png auto pulled via a custom WordPress plugin using the variable $linkImg.
$strHtml = "
<div style='border: solid 1px #00b7f3; background-color: #f8f8f8; width: 656px; height: 186px; padding: 0px; float: left; margin-top: 4px;'>
<div style='float: left; width: 175px; margin: 0px; text-align: center; padding-left: 10px; padding-top: 15px;'>
<img src='$linkImg' width='119' height='119' style='margin: 0px; padding: 15px;'/>
</div>
</div>
";
Any ideas? (Btw, first post)
Edit 2 - This seems to do nothing, am I missing something obvious?
$strHtml = "
<div style='border: solid 1px #00b7f3; background-color: #f8f8f8; width: 656px; height: 186px; padding: 0px; float: left; margin-top: 4px; border-top-left-radius: 50px 50px;'>
<div style='float: left; width: 175px; margin: 0px; text-align: center; padding-left: 10px; padding-top: 15px;'>
<img src='$linkImg' width='119' height='119' style='margin: 0px; padding: 15px;'/>
</div>
</div>
";
This is an issue of css not php.
Use inline css if you cannot link an external css file.
Try http://www.css3.info/preview/rounded-border for Css3 rounded corners.
And http://www.devwebpro.com/25-rounded-corners-techniques-with-css/ for other hacks.
*******edit****
I am using operamini so I can't read your code. Also I can't post comments due to a wierd js issue.
The problem with css3 is it is not supported by all browsers and each browser currently does not use the standard. You need to find the -moz- specific and -webkit- specific versions. It isn't guaranteed to work unless the browser uses an engine which supports it.

Resources