How should I convert this PSD to HTML & CSS Menu - html

I'm trying to convert this PSD to HTML with CSS.
And this is what I've got so far (using CSS3).
But I've no idea how to put a divider between the menu items. Any ideas?
EDIT: Seems example images aren't showing. So here they are.
The PSD File
http://postimage.org/image/2qywn3nj8/
What I've got so far
http://postimage.org/image/1ylhjsv2c/
#nav
{
padding:0;
margin:0;
height: 35px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
background-image: -moz-linear-gradient(top, #ffffff, #eaecec);
-moz-box-shadow: 0 0 1px #888;
}
#nav ul
{
margin-top: 0px;
margin-left: 0;
Font-Family: Arial;
font-size: 10pt;
list-style: none;
padding-top: 8px;
color: #000000;
}
#nav ul li
{
display: inline;
padding-left: 30px;
}

You could try adding an empty li and style it as your separator. I think that would be ugly codewise, but something like this works:
CSS:
#nav
{
padding:0;
margin:0;
height: 35px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
background-image: -moz-linear-gradient(top, #ffffff, #eaecec);
-moz-box-shadow: 0 0 1px #888;
}
#nav ul
{
margin-top: 0px;
margin-left: 0;
Font-Family: Arial;
font-size: 10pt;
list-style: none;
padding-top: 8px;
color: #000000;
}
#nav ul li
{
display: inline;
padding-left: 15px;
}
#nav ul li.sep{
background-image: -moz-linear-gradient(top, #eaecec, #555555);
padding-left:1px;
margin-left: 15px;
}
HTML:
<div id="nav">
<ul>
<li>test</li>
<li class="sep"></li>
<li>test2</li>
<li class="sep"></li>
<li>test3</li>
<li class="sep"></li>
<li>test</li>
<li class="sep"></li>
<li>test2</li>
<li class="sep"></li>
<li>test3</li>
</ul>
</div>

Maybe put a 1px wide div in between each and give it some type of edged border like groove, ridge, inset, outset? Or you could use an image...but that seems silly for something so little.

You could use something like:
#nav ul li {
display: inline;
padding-left: 30px;
border-left: 1px solid #THE-WHITE-COLOR;
border-right: 1px solid #THE-GREY-COLOR;
}
and then just use border-left: none; and border-right: none; as some extra markup on the first and last #navl ul li's
Might get tricky with the space you got there at the top and bottom of the lines.. but you know.. you can do iit.

Your menus should like this :
HTML:
<div id="nav">
<ul>
<li>Rates & Plans</li>
<li>Phones</li>
<li>Rates</li>
<li>Booking</li>
<li>Coverage</li>
<li>FAQ</li>
<li>Support</li>
</ul>
</div>
CSS:
#nav{
// Background
}
#nav ul
padding:0;margin:0 0 0 30px;
}
#nav li{
background:url(separator.png) no-repeat 100% 0%;
padding: 10px 15px;
margin: 0 2px;
}

The easiest option would be to have an empty list element after each nav item and then style it accordingly, however this isn't very semantic.
You could also try using a CSS selector such as :after ( http://www.w3schools.com/cssref/sel_after.asp )

Related

the nav bar won't go to the center

Whatever I do I can't get the navigation to center.
I have a wrapper and the navigation bar has an underline across this div. The top of the buttons are rounded of so it just looks like they are coming out of the bottom border.
I've tried searching for a good way to center them. A lot of people use margin auto or margin 0 auto. Other people also use this in combination with display inline-block but then the border gets cut off from the nav buttons.
This is my HTML:
<div id="nav">
<ul>
<li>Home</li>
<li>About me</li>
<li>Portfolio</li>
<li>CV</li>
<li>Contact</li>
</ul>
</div>
The CSS:
#nav {
margin: auto;
color: #FFFFFF;
width: 100%;
border-bottom: 1px solid #000000;
}
#nav ul {
margin: auto;
padding-top: 6px;
padding-bottom: 8px;
padding-left: 5px;
list-style:none;
}
#nav li {
display: inline;
width: 120px;
margin:0;
padding: 10px 5px;
border-radius: 10px 10px 0px 0px / 10px 10px 0px 0px;
background : -webkit-gradient(linear, left top, left bottom, from(rgb(100,100,100)), to(rgb(132,132,132)));
background : -moz-linear-gradient(top, rgb(200,200,200), rgb(232,232,232));
}
#nav li:last-child {
border-right: none;
}
#nav a {
text-decoration: none;
color: #383838;
font-weight: bold;
font-size: 20px;
padding-right: 10px;
padding-left: 5px;
}
For the ease for you i've also put it in a js fiddle http://jsfiddle.net/ge702rna/
Really hope someone can help me out because i've got my hands tied up in my hair right now.
Probally i'm just doing something simple wrong.
Simply add text-align:center;
#nav {
color: #FFFFFF;
width: 100%;
border-bottom: 1px solid #000000;
text-align:center; /* <-- ADD THIS LINE */
}
I just change the width in
#nav {
margin: auto;
color: #FFFFFF;
width: 77%; //changed
border-bottom: 1px solid #000000;
}
Are you looking for this..DEMO

Transparent menu with sections 'cut-out'

I'm asked to create a html/css menu such as the following picture:
This looks a simple menu to me, wasn't it by the fact that it has 'cut-out' sections between the menu items. I don't think it's clear from the image but the upper and lower part of the menu are connected with one another. Let me explain that with the use of a picture created in paint:
The grey area's are the 'cut-out' parts I was talking about. The upper and lower part are connected with each other.
I hope this is clear and I'm hoping for someone to help. Thanks in advance!
EDIT:
Herewith some code sample and JSFiddle, this is how far I got.
<div class="behandelingen-en-prijzen">
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
.behandelingen-en-prijzen
{
}
.behandelingen-en-prijzen ul li
{
display: inline-block;
padding: 20px;
background-color: #000;
background-color:rgba(0,0,0,0.3);
}
.behandelingen-en-prijzen ul li a
{
text-transform: uppercase;
color: #000;
}
you can do it without using images
HTML
<ul class="cutout">
<li>
home
</li>
<li>
about
</li>
<li>
contact
</li>
</ul>
CSS
body{ background: url(https://i.imgur.com/lsoomRq.jpg); }
.cutout{ list-style: none; padding: 0; border: 3px solid rgba(235, 235, 235, 0.8); }
.cutout, .cutout li{ height: 40px; line-height: 40px; overflow: hidden; }
.cutout li{ float: left; width: 33.33%; text-align: center; }
.cutout a{ display: block; margin-right: 3px; background: rgba(235, 235, 235, 0.8); color: #555; text-transform: uppercase; font-family: sans-serif; text-decoration: none;}
.cutout a:hover{background: #fff}
.cutout li:last-child{ float: right; }
.cutout li:last-child a{margin-right: 0; }
Updated the fiddle: http://jsfiddle.net/a7d9v/3/
Removed padding from li and left 1px, added padding to a and floated the li - left.
<div class="behandelingen-en-prijzen">
<ul>
<li>Home</li>
<li>About</li>
<li><a class="no-border" href="#">Contact</a></li>
</ul>
</div>
.behandelingen-en-prijzen ul {
list-style: none;
width: 100%;
}
.behandelingen-en-prijzen ul li
{
float: left;
padding: 1px;
background-color: #000;
background-color:rgba(0,0,0,0.3);
}
.behandelingen-en-prijzen ul li a
{
text-transform: uppercase;
color: #fff;
display: block;
padding: 20px;
border-right: 1px solid #fff;
}
.behandelingen-en-prijzen ul li a.no-border {
border: none;
}

CSS Ul li navigation issue: Can't get correct result

Trying to get following result when I hover
for markup below
<ul>
<li>Current Month</li>
<li>Current Week</li>
<li>Previous Month</li>
<li>Previous Week</li>
<li>Next Month</li>
<li>Next Week</li>
<li>Team Calendar</li>
<li>Private Calendar</li>
<li>Settings</li>
</ul>
Can't figure out solution using CSS3 border-radius. Any suggestions?
Update
Please don't post dotted lists. I need solution for arrowed list.
It's not same thing: when you use arrow, you need to set it as background-image of li.
There is another way, to set arrow as a bullet picture, but this time you have no way to control gap between arrow and link.
li:hover {
background-color:#e4e4e4;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
jsfiddle
EDIT
If you want to use arrows instead, just use the :before pseudo element.
ul {
list-style-type:none;
}
li {
padding:5px;
}
li:hover {
width:100px;
background-color:#e4e4e4;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
li:before {
content:"> ";
}
updated jsFiddle
Just replace the > with your image.
EDIT 2
To have the background only over the text, just add that style to the link instead of the li then.
http://jsfiddle.net/SEzxP/2/
EDIT 3
To use an image instead, just use url() after content
li:before { content:url('http://www.nationalacademies.org/xpedio/groups/system/documents/webgraphics/na_right_arrow.gif') /* with class ModalCarrot ??*/
}
Updated jsFiddle
<style>
.my-list li a{
text-decoration:none;
color:#000;
}
.my-list li a:hover
{
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
text-decoration: none;
background-color: #e4e4e4;
}
.my-list li{
list-style-image:url(http://www.nationalacademies.org/xpedio/groups/system/documents/webgraphics/na_right_arrow.gif)
}
</style>
<ul class="my-list">
<!--Example of gap using whitespace-->
<li> Current Month</li>
<!--Example of a gap using padding for finer control of desired gap-->
<li><a style="padding-left:20px;" href="#">Current Week</a></li>
<li>Previous Month</li>
<li>Previous Week</li>
<li>And so on...</li>
</ul>
See jsFiddle also: http://jsfiddle.net/KRaJN/3/
Something like this?
jsFiddle here
CSS
ul {
list-style:none;
background:#E6E6E6;
border-left:3px solid rgb(0, 194, 255);
}
li a {
text-decoration:none;
color:black;
}
li a:hover {
border-radius:5px;
background: #cacaca;
}
li:before {
content:"►";
font-size:10px;
margin-right:10px;
}
body {
background-color: #F3F3F3;
}
ul {
list-style: none;
margin: 0;
padding: 0;
font-family: Arial, Tahoma;
font-size: 13px;
border-left: 1px solid #4AFFFF;
padding-left: 10px;
}
li {
margin: 0;
padding: 0;
}
li:before {
content: " ";
display:inline-block;
border-style: solid;
border-width: 5px 0 5px 5px;
border-color: transparent transparent transparent #000000;
}
li a {
margin-left: 5px;
display: inline-block;
border-radius: 3px;
color: #000;
padding: 3px 5px;
text-decoration: none;
width: 150px;
}
li a:hover {
background-color: #DBDBDB;
font-weight: bold;
}
This should be ezactly how you want it!
http://jsfiddle.net/2JJaW/

Pseudo Underline Selector for menu

I have a horizontal list menu, on which I want to use pseudo selectors: When you hover over the menu item, it should have a thick color underline. Each Menu item have a different width and its underlining effect should match that width
Here is a sample website with its underlining menus: http://www.theblackswantheory.org/
Here is my list:
<div id="other">
<div id="otherTable">
<ul id="ul1">
<li>Web Design</li>
<li>Graphic Design</li>
<li>Google Search Optimization</li>
</ul>
</div>
</div>
CSS:
#otherTable{
display: table;
margin: 0 auto;
}
#otherTable ul{
list-style: none;
}
#otherTable ul li{
display: inline;
margin: 10px;
}
ul#ul1{
color: #fff;
}
So what is the best way of going about this? I tried several things but does not work well (tables, another list below with the underlines etc...)
I would like it pure CSS and no javascript if possible...Which I believe it is
Thank You
Use a bottom border to simulate an underline (see jsfiddle):
#otherTable ul li:hover {
border-bottom: solid red 0.2em;
}
ul#ul1 > li:hover{
text-decoration:underline;
}
http://jsfiddle.net/Tymek/2P8UL/
HTML
<div id="menu">
<ul>
<li>Web Design</li>
<li>Graphic Design</li>
<li>Google Search Optimization</li>
</ul>
</div>​
CSS
#menu ul,
#menu li,
#menu a {
background: #111;
}
ul#menu {
list-style: none;
}
#menu li {
display: block;
float: left;
}
#menu a {
display: block;
margin: 0 0.5em;
padding: 15px 0 7px;
color: #ccc;
text-decoration: none;
text-transform: uppercase;
font: 13px/18px Arial, Helvetica, sans-serif;
font-weight: 300;
}
#menu a:hover {
color: #fff;
padding-bottom: 4px;
border-bottom: 3px solid #f00;
}
Key part:
#menu a {
padding: 15px 0 7px;
}
#menu a:hover {
padding-bottom: 4px;
border-bottom: 3px solid #f00;
}
Next time use firebug, or something to analize your example.
​

Menus and sub Menus problem?

Using CSS Style Sheet
In my web page, i have two class like menu and leftside. In menu i have the ul, li classes. i want to use a ul, li in left side also, but the problem is if i used the ul, li, it was matching with menu ul, li
ul -underlist, li - list
I tried to change the code of sheet,
my css code.
#leftside{
float: left;
width: 230px;
margin-left: 5px;
margin-top: 15px;
overflow: hidden;
font: 13px Arial, Helvetica, sans-serif;
}
a {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: maroon;
}
ul {
padding: 10px 10px 2px 0;
margin: 0px;
list-style: none;
}
li li {
margin-left: 10px;
margin-right: 10px;
line-height: 30px;
padding-left: 15px;
border-bottom: 1px dashed #BDBDBD;
background: url(images/img04.jpg) no-repeat left 50%;
}
Html Code
<li>
<ul>
<li>Company Profile</li>
<li>Enquiry</li>
<li>Career</li>
<li>Location Map</li>
</ul>
</li>
ul, list are matching with the menu ul, li
How to solve this issue. Please.
To reduse the amount of space above the inner list change the padding for the ul so that it is 0 or negative.
For Example:
ul {
padding: 0 10px 2px 0;
margin: 0px;
list-style: none;
}
You can also use a special style sheet to correct the problem in Internet Explorer by doing something like this:
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="iespecific.css" />
<![endif]-->
You would then need a second CSS file named iespecific.css which has the above ul styling in it.
Use an id to distinguish between the two.
For example the HTML would be:
<ul id="outter">
<li>The Outter List</li>
<li>More Outter List
<ul id="inner">
<li>This is the inner list</li>
<li>Company Profile</li>
<li>Enquiry</li>
<li>Career</li>
<li>Location Map</li>
</ul>
</li>
<li>Still The Outter</li>
</ul>
In the CSS you would have something like this:
#outter ul {
padding: 10px 10px 2px 0;
list-style: none;
}
#outter li {
margin-left: 10px;
line-height: 30px;
padding-left: 15px;
}
#inner ul {
padding: 10px 10px 2px 15px;
list-style: none;
}
#inner li {
margin-left: 10px;
margin-right: 10px;
line-height: 30px;
padding-left: 15px;
border-bottom: 1px dashed #BDBDBD;
background: url(images/img04.jpg) no-repeat left 50%;
}
This looks something like this:
alt text http://img16.imageshack.us/img16/2376/examplesg.png