I am creating a footer. Almost everything is finished. However, I can't align the "ul" elements perfectly. More specifically, I can't align the elements to the left. Please, take a look at my pen.
https://codepen.io/john9929/pen/yvrWpP
As you can see the sprouts under "CONTACT" and "About us," "Contact us" etc under "INFORMATION" are not aligned perfectly to the left.
Here are my codes for footer:
<!-- footer -->
<div class="footer">
<div class="container">
<div class="w3_footer_grids">
<div class="col-md-3 w3_footer_grid">
<h3>Contact</h3>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse.</p>
<ul class="address">
<li><i class="glyphicon glyphicon-map-marker" aria-hidden="true"></i>1234k Avenue, 4th block, <span>New York City.</span></li>
<li><i class="glyphicon glyphicon-envelope" aria-hidden="true"></i>info#example.com</li>
<li><i class="glyphicon glyphicon-earphone" aria-hidden="true"></i>+1234 567 567</li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Information</h3>
<ul class="info">
<li>About Us</li>
<li>Contact Us</li>
<li>Short Codes</li>
<li>FAQ's</li>
<li>Special Products</li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Category</h3>
<ul class="info">
<li>Mobiles</li>
<li>Laptops</li>
<li>Purifiers</li>
<li>Wearables</li>
<li>Kitchen</li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Profile</h3>
<ul class="info">
<li>Home</li>
<li>Today's Deals</li>
</ul>
<h4>Follow Us</h4>
<div class="agileits_social_button">
<ul>
<li> </li>
<li> </li>
<li> </li>
<li> </li>
</ul>
</div>
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="footer-copy">
<div class="footer-copy1">
<div class="footer-copy-pos">
<img src="images/arrow.png" alt=" " class="img-responsive" />
</div>
</div>
<div class="container">
<p>© 2017 Electronic Store. All rights reserved </p>
</div>
</div>
</div>
<!-- //footer -->
Here are the CSS codes:
/*-- footer --*/
.footer{
padding:4em 0;
background:#fff;
}
.w3_footer_grid h3{
color: #212121;
font-size: 1.5em;
margin-bottom: 2em;
padding-bottom: .5em;
position: relative;
text-transform: uppercase;
}
.w3_footer_grid h3:after{
content:'';
background:#3c43a4;
width:20%;
height:2px;
position:absolute;
bottom:0;
left:0;
}
.w3_footer_grid p{
color:#999;
line-height:1.8em;
margin-bottom:2em;
}
.w3_footer_grid ul li {
list-style-type: none;
margin-bottom: 1em;
color: #999;
font-size: 14px;
}
.w3_footer_grid ul.address li i {
color:#414141;
border: 1px solid #414141;
padding: .5em;
margin-right: 1em;
}
.w3_footer_grid ul.address li span {
display: block;
margin-left: 3em;
}
.w3_footer_grid ul li a {
color: #999;
text-decoration: none;
}
.w3_footer_grid ul li a:hover {
color:#212121;
}
.w3_footer_grid ul.info li a {
padding-left:2.2em;
background: url(../img/img-sp.png) no-repeat -6px -98px;
}
.w3_footer_grid h4{
margin:2em 0 1em;
font-size:1.2em;
color:#3c43a4;
}
/*-- social-buttons --*/
.agileits_social_button ul li{
display:inline-block;
margin: 0 !important;
}
.agileits_social_button ul li a{
background: url(../img/img-sp.png) no-repeat 1px -130px #414141;
display: block;
width: 35px;
height: 35px;
-webkit-transition:.5s all;
-moz-transition:.5s all;
-o-transition:.5s all;
-ms-transition:.5s all;
transition:.5s all;
}
.agileits_social_button ul li a.twitter{
background-position:-41px -130px;
}
.agileits_social_button ul li a.google{
background-position:-81px -130px;
}
.agileits_social_button ul li a.pinterest{
background-position:-123px -130px;
}
.agileits_social_button ul li a:hover {
background-color: #3c43a4;
display: block;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.footer-copy1 {
position: relative;
padding: 2em 0 0;
border-bottom: 1px solid #d6d6d6;
}
.footer-copy-pos {
position: absolute;
right: 12%;
bottom: -75%;
width: 50px;
height: 50px;
border: 3px solid #ff5063;
border-radius: 25px;
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
-o-border-radius: 25px;
-ms-border-radius: 25px;
box-shadow: 0px 0px 5px 0px #ff5063;
-webkit-transition:.5s all;
-moz-transition:.5s all;
transition:.5s all;
}
.footer-copy-pos:hover {
box-shadow: 0px 0px 30px 5px #ff5063;
}
.footer-copy p{
margin:4em 0 0;
text-align:center;
color:#999;
line-height:1.8em;
}
.footer-copy p a{
color:#3c43a4;
text-decoration:none;
}
.footer-copy p a:hover{
color:#999;
}
/*-- //footer --*/
How can I fix this issue?
Try the following code:
.w3_footer_grid ul{
padding-left:0;
}
Your question is not very precise. You want all your <li> elements all the way to the left? Then remove the padding you have given it here:
.w3_footer_grid ul.info li a {
padding-left:2.2em;
background: url(../img/img-sp.png) no-repeat -6px -98px;
}
Related
Hi I am a novice at coding and am learning by myself at home. I have run into a problem which I simply cannot solve.
Firstly, here is the codepen link for the site:
http://codepen.io/sheahan/pen/ygKabM
The website is working pretty much seamlessly except for one issue.
Take a look at the 'item' list on the left side of the page. I have set it up so that on a hover the font color, background color, and font size change (i had to change the padding in order to ensure that the li stayed the same size). This works fine when the screen size is above 900px.
Now I have made the page responsive and set a media query to change the layout below 900px. The item list moves to the top of the page with a new format its laid out in a grid rather than a single column. This looks to work fine except for the last item on the right of each row (item 3 and item 6). Whenever I hover over it it pushes the next item in line over two spaces to the right leaving two empty spaces. One of the HTML editors I am using shows the presence of two "ghost" li items that aren't there.
Any guesses?
I'm also open to any comments or criticisms of the site, eager to learn.
Here's the raw code
<html>
<head>
<title>Food Supply Company</title>
<link href="FoodSupplyStyle.css" rel="stylesheet" text="text/css">
<link href="https://fonts.googleapis.com/css?family=Volkhov:700|Alegreya:900" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="title">
<h1>Food Supply Company</h1>
</div>
<ul class="menunav">
<ul class="Products">
<li><a href="#" >Products</a>
<ul class="productsnav">
<li>Products</li>
<li>Fruits</li>
<li>Vegetables</li>
<li>Dry Foods</li>
<li>Spices</li>
</ul>
</li>
</ul>
<ul class="AboutUs">
<li><a href="#" >About Us</a>
<ul class="aboutusnav">
<li>About Us</li>
<li>History</li>
<li>Mission</li>
<li>Personel</li>
</ul>
</li>
</ul>
<ul class="Contact">
<li><a href="#" >Contact</a></li>
</ul>
</ul>
<div class="ProductMain">
<div class="sidebar">
<div class="logoholder">
<img src="https://c1.staticflickr.com/1/501/32498772122_9137841b84_o.png" alt="Company Logo Letters Only" height="130" width="130">
</div>
<div class="sidebarlinks">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
<li>Item 7</li>
<li class="lastitem">Item 8</li>
</ul>
</div>
</div>
<div class="maincontent">
<h1 class="productname">Item Name</h1>
<img src="http://pngimg.com/upload/mango_PNG9168.png" >
<div class="Attributes">
<div class="Titles">
<ul>
<li>Country:</li>
<li>Variety:</li>
<li>Season:</li>
</ul>
</div>
<div class="Names">
<ul>
<li>Australia</li>
<li>Tastey</li>
<li>October-December</li>
</ul>
</div>
</div>
<div class="Description">
You can add a description of the item. Mention the history, the taste and other attributes of the product.
</div>
</div>
</div>
<div class="foot">
<div class="footer left">Website Designer<br>Happy Designs Inc.<br>Qatar</div>
<div class="footer center">© Food Supply Company</div>
<div class="footer right">P.O.Box 11111<br>Doha<br>Qatar</div>
</div>
</div>
</body>
</html>
CSS
*{
Margin:0;
padding:0;
border-radius:5px;
font-family: 'Verdana',sans-serif;
}
body{
background-image: url(https://c1.staticflickr.com/1/470/32498869432_082f3cf148_o.jpg);
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
}
.container{
width: 900px;
margin:auto;
position:relative;
}
h1{
font-family: 'Alegreya:900','Verdana',sans-serif;
padding:20px 0 15px 0;
text-align: center;
font-weight: 900;
font-size:65px;
letter-spacing: 2px;
color:coral;
text-shadow: 3px 3px 1px grey;
Width: 100%;
margin:10px 0 20px 0;
}
a{
text-decoration: none;
text-align: center;
font-family: 'verdana', sans-serif;
}
p{
font-family: 'verdana', sans-serif;
}
li{
list-style-type:none;
}
.menunav{
margin:5px 0 30px 0;
overflow:auto;
font-size: 20px;
}
.menunav a{
float:left;
margin:0px 3px 5px 3px;
width:293px;
padding: 5px 0px 5px 0px;
background-color: rgba(255,127,80,0.85);
color: bisque;
box-shadow: 2px 2px 2px 0px darkgray;
}
.menunav a:hover{
background-color: bisque;
color: coral;
}
.productsnav, .aboutusnav{
position:absolute;
top:134px;
background-color:rgba(0,0,0,0);
z-index: 1;
}
.aboutusnav{
margin-left:298px;
}
.productsnav a, .aboutusnav a{
width:293px;
display: none;
background-color:coral;
}
.Products:hover .productsnav a{
display:block;
}
.AboutUs:hover .aboutusnav a{
display:block;
}
.ProductMain{
position:relative;
overflow: auto;
margin-bottom:18px;
padding-bottom:5px;
}
.sidebar{
float:left;;
width:250px;
margin-left:3px;
}
.sidebar a{
font-size: 16px;
display: block;
padding: 15px 0px;
background-color: rgba(255, 228, 196,0.85);
color:coral;
font-weight: bold;
margin-bottom:5px;
box-shadow: 2px 2px 2px 0px darkgray;
}
.sidebar a:hover{
color:lightgray;
background-color:coral;
font-size:20px;
padding:13px 0px;
}
.sidebar .logoholder a{
background-color:rgba(0,0,0,0);
box-shadow: none;
}
.sidebar .logoholder a:hover{
padding:15px 0px 13px 0px;
}
.logoholder img{
background-color: rgba(0,0,0,0);
}
.lastitem a{
margin-bottom: 0px;
}
.maincontent {
background-color:rgba(244,164,96,0.8);
position:absolute;
left: 270px;
height: 99.2%;
width: 600px;
box-shadow: 2px 2px 7px 2px darkgray;
box-sizing:border-box;
}
.productname{
font-size:35px;
margin:0;
padding: 20px 0 15px 0;
background-color: rgba(0,0,0,0);
color: bisque;
border-bottom-style:double;
border-bottom-width: 4px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
border-bottom-color:bisque;
box-shadow: none;
}
.maincontent img{
float:left;
width:250px;
height:240px;
background-color:rgba(0,0,0,0);
margin: 20px -5px 0px 30px;
}
.Attributes{
position:relative;
right:-8px;
top:35px;
overflow:auto;
height:auto;
padding: 0px 5px;
background-color:rgba(255, 228, 196,0.5) ;
border-style:inset;
border-width: 3px;
margin-bottom:90px;
width:270px;
}
.Titles, .Names{
display: inline-block;
line-height:3.7em;
}
.Titles li, .Names li{
border-radius: 0;
font-weight: bold;
color:chocolate;
}
.Titles li{
font-size:17px;
text-align: center;
}
.Names li{
padding-left:5px;
}
.Description{
width:500px;
height:180px;
overflow:auto;
margin:auto;
padding: 10px 15px ;
background-color:rgba(255, 228, 196,0.5);
border-style:inset;
border-width: 3px;
color:chocolate;
line-height:1.5em;
}
.foot{
width: 860px;
height:70px;
background-color: rgba(255, 228, 196,0.9);
margin: 10px 0px;
box-shadow: 2px 2px 2px 0px darkgray;
padding: 10px 20px 20px 20px;
color:coral;
}
.footer{
display:inline-block;
width:33%;
background-color: rgba(0,0,0,0);
height:100%;
padding:10px;
box-sizing:border-box;
margin:-3px;
font-size: 15px;
line-height:1.5em;
}
.right{
text-align: right;
}
.center{
text-align:center;
}
#media screen and (max-width:920px){
.container{
width: 600px;
margin:auto;
position:relative;
}
.menunav a{
float:left;
width:32%;
}
.productsnav{
position:absolute;
top: 213px;
}
.aboutusnav{
position:absolute;
top: 213px;
margin-left:198px;
}
.productsnav a, .aboutusnav a{
width:190px;
}
.ProductMain{
position: relative;
height:800px;;
margin-bottom:18px;
margin-right: 0px;
padding-bottom:5px;
width:600px;
}
.logoholder{
display:none;
}
.sidebar{
width:99%;
position:relative;
float:none;
display:inline-block;
padding-left:10px;
}
.sidebar a{
width:32%;
float:left;
margin-right:5px;
}
.maincontent
{
position:static;
margin-top:15px;
height:600px;
width:99%;
}
.foot{
width:100%;
padding:0;
height:90px;
}
.footer{
margin-top:0;
}
.left{
margin-left: 13px;
}
.center{
width:30%;
}
.sidebar a:hover{
color:lightgray;
background-color:coral;
font-size:24px;
padding:10px 0;
}
}
A shortest way to resolve the issue is to set font-size:23px; for .sidebar a:hover
.sidebar a:hover{
color:lightgray;
background-color:coral;
font-size:23px;
padding:10px 0;
}
codepen
There's a gray box on the middle of my website. I've double checked all of the code, and I can't figure out what's creating this. I'm sorry for asking such a stupid question, I'm quite new to this. Here's the code -
.nav a {
color: black;
font-size: 11px;
font-weight: bold;
padding: 14px 10px;
text-transform: uppercase;
}
.nav li {
display: inline;
}
.jumbotron {
height: 500px;
background-repeat: no-repeat;
background-size: cover;
}
.jumbotron .container {
position: relative;
top:100px;
}
.nav a {
color: #5a5a5a;
font-size: 11px;
font-weight: bold;
padding: 14px 10px;
text-transform: uppercase;
}
.nav li {
display: inline;
}
.jumbotron {
height: 500px;
background-repeat: no-repeat;
background-size: cover;
}
.jumbotron .container {
position: relative;
top:100px;
}
.jumbotron h1 {
color: #fff;
font-size: 48px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.jumbotron p {
font-size: 20px;
color: #fff;
}
.learn-more h3 {
font-family: 'Shift', sans-serif;
font-size: 18px;
font-weight: bold;
}
.learn-more a {
color: #00b0ff;
}
.neighborhoood-guides {
border-bottom: 1px solid #dbdbdb
}
.clearfix:after {
display:block;
clear:both;
}
/*----- Menu Outline -----*/
.menu-wrap {
width:100%;
box-shadow:0px 1px 3px rgba(0,0,0,0.2);
background:#fff;
}
.menu {
width:1000px;
margin:0px auto;
}
.menu li {
margin:0px;
list-style:none;
}
.menu a {
transition:all linear 0.15s;
color:black;
}
.menu li:hover > a, .menu .current-item > a {
text-decoration:none;
color:dodgerblue;
}
.menu .arrow {
font-size:11px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:11px;
}
.menu > ul > li > a {
padding:10px 10px;
display:inline-block;
text-shadow:0px 1px 0px rgba(0,0,0,0.4);
text-transform:uppercase;
font-weight:bold;
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a {
background:#fff;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu {
z-index:1;
opacity:1;
}
.sub-menu {
width:160%;
padding:5px 0px;
position:absolute;
top:100%;
left:0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 2px 3px rgba(0,0,0,0.2);
background:#fff;
}
.sub-menu li {
display:block;
font-size:11px;
}
.sub-menu li a {
padding:10px 30px;
display:block;
text-transform: uppercase;
font-weight:bold
}
.sub-menu li a:hover, .sub-menu .current-item a {
background:#fff;
}
.neighborhood-guides h2 {
font-size: 48px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.neighborhood-guides p {
font-size: 24px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.socialmedia {
background: #498FCC;
}
.neighborhood-guides {
padding: 20px 20px;
}
.allrights li p {
color: white;
font-family: 'Shift', sans-serif;
}
.whole {
background-image:url('http://i.imgur.com/3ay8hjS.jpg');
background-repeat: no-repeat;
background-size: cover;
}
<!DOCTYPE html>
<html>
<div class="whole">
<head>
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
<link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<div class="menu-wrap">
<nav class="menu">
<ul class="clearfix">
<li>Home</li>
<li>About Us</li>
<li> Contact Us</li>
<li>
Destinations <span class="arrow">▼</span>
<ul class="sub-menu">
<li>Airlines</li>
<li>Hotels</li>
</ul>
</li>
<li>Cruiselines</li>
<li>Weddings & Honeymoons</li>
<li>
Useful Information <span class="arrow">▼</span>
<ul class="sub-menu">
<li>Travel Insurance</li>
</ul>
</li>
<li>Careers</li>
</ul>
</nav>
</div>
<div class="jumbotron">
<div class="container">
</div>
</div>
<center>
<h2></h2>
<p></p>
<h1></h1>
<div class="row">
<div class="col-md-4">
<div class="Thumbnail">
<img src="">
</div>
</div>
<div class="col-md-4">
<div class="Thumbnail">
<img src="">
</div>
</div>
<div class="col-md-4">
<div class="Thumbnail">
<image src="">
</div>
</div>
</div>
</center>
<center>
<div class="learn-more">
<div class="container">
<div class="row">
<div class="col-md-4">
<h3></h3>
<p></p>
<p></p>
</div>
<div class ="col-md-4">
<h3></h3>
<p>.</p>
<p></p>
</div>
<div class ="col-md-4">
<h3></h3>
<p></p>
<p></p>
</div>
</div>
</div>
</center>
</div>
<div class="socialmedia">
<nav class="menu">
<ul class="clearfix">
</ul>
</nav>
</div>
<center>
<h2></h2>
<h2></h2>
<h2></h2>
</center>
<h2></h2>
<h2></h2>
<div class="socialmedia">
<nav class="menu">
<ul class="clearfix">
<div class="allrights">
<center><li><p>Travel Away Corporation All Rights Reserved 2015</p></li></center>
</ul>
</div>
</nav>
</div>
</div>
</body>
</html>
Remove the following attribute: background-color: #eee; */, otherwise, I've put your same code on the fiddle and didn't see any issue.
Replace your .jumbotron class with this
.jumbotron {
padding: 30px;
margin-bottom: 30px;
color: inherit;
}
Whenever you have such a problem, right click on your mouse and select Inspect element and then click on the html element (which has css applied on it) and see which properties are checked and which are not. You should easily fix your problem then.
This is a broad question because you don't say what you want to appear there instead of this large grey square, but to answer your specific question: remove the jumbotron markup from the HTML and it will disappear:
.nav a {
color: black;
font-size: 11px;
font-weight: bold;
padding: 14px 10px;
text-transform: uppercase;
}
.nav li {
display: inline;
}
.jumbotron {
height: 500px;
background-repeat: no-repeat;
background-size: cover;
}
.jumbotron .container {
position: relative;
top:100px;
}
.nav a {
color: #5a5a5a;
font-size: 11px;
font-weight: bold;
padding: 14px 10px;
text-transform: uppercase;
}
.nav li {
display: inline;
}
.jumbotron {
height: 500px;
background-repeat: no-repeat;
background-size: cover;
}
.jumbotron .container {
position: relative;
top:100px;
}
.jumbotron h1 {
color: #fff;
font-size: 48px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.jumbotron p {
font-size: 20px;
color: #fff;
}
.learn-more h3 {
font-family: 'Shift', sans-serif;
font-size: 18px;
font-weight: bold;
}
.learn-more a {
color: #00b0ff;
}
.neighborhoood-guides {
border-bottom: 1px solid #dbdbdb
}
.clearfix:after {
display:block;
clear:both;
}
/*----- Menu Outline -----*/
.menu-wrap {
width:100%;
box-shadow:0px 1px 3px rgba(0,0,0,0.2);
background:#fff;
}
.menu {
width:1000px;
margin:0px auto;
}
.menu li {
margin:0px;
list-style:none;
}
.menu a {
transition:all linear 0.15s;
color:black;
}
.menu li:hover > a, .menu .current-item > a {
text-decoration:none;
color:dodgerblue;
}
.menu .arrow {
font-size:11px;
line-height:0%;
}
/*----- Top Level -----*/
.menu > ul > li {
float:left;
display:inline-block;
position:relative;
font-size:11px;
}
.menu > ul > li > a {
padding:10px 10px;
display:inline-block;
text-shadow:0px 1px 0px rgba(0,0,0,0.4);
text-transform:uppercase;
font-weight:bold;
}
.menu > ul > li:hover > a, .menu > ul > .current-item > a {
background:#fff;
}
/*----- Bottom Level -----*/
.menu li:hover .sub-menu {
z-index:1;
opacity:1;
}
.sub-menu {
width:160%;
padding:5px 0px;
position:absolute;
top:100%;
left:0px;
z-index:-1;
opacity:0;
transition:opacity linear 0.15s;
box-shadow:0px 2px 3px rgba(0,0,0,0.2);
background:#fff;
}
.sub-menu li {
display:block;
font-size:11px;
}
.sub-menu li a {
padding:10px 30px;
display:block;
text-transform: uppercase;
font-weight:bold
}
.sub-menu li a:hover, .sub-menu .current-item a {
background:#fff;
}
.neighborhood-guides h2 {
font-size: 48px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.neighborhood-guides p {
font-size: 24px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}
.socialmedia {
background: #498FCC;
}
.neighborhood-guides {
padding: 20px 20px;
}
.allrights li p {
color: white;
font-family: 'Shift', sans-serif;
}
.whole {
background-image:url('http://i.imgur.com/3ay8hjS.jpg');
background-repeat: no-repeat;
background-size: cover;
}
<!DOCTYPE html>
<html>
<div class="whole">
<head>
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet">
<link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<div class="menu-wrap">
<nav class="menu">
<ul class="clearfix">
<li>Home</li>
<li>About Us</li>
<li> Contact Us</li>
<li>
Destinations <span class="arrow">▼</span>
<ul class="sub-menu">
<li>Airlines</li>
<li>Hotels</li>
</ul>
</li>
<li>Cruiselines</li>
<li>Weddings & Honeymoons</li>
<li>
Useful Information <span class="arrow">▼</span>
<ul class="sub-menu">
<li>Travel Insurance</li>
</ul>
</li>
<li>Careers</li>
</ul>
</nav>
</div>
<center>
<h2></h2>
<p></p>
<h1></h1>
<div class="row">
<div class="col-md-4">
<div class="Thumbnail">
<img src="">
</div>
</div>
<div class="col-md-4">
<div class="Thumbnail">
<img src="">
</div>
</div>
<div class="col-md-4">
<div class="Thumbnail">
<image src="">
</div>
</div>
</div>
</center>
<center>
<div class="learn-more">
<div class="container">
<div class="row">
<div class="col-md-4">
<h3></h3>
<p></p>
<p></p>
</div>
<div class ="col-md-4">
<h3></h3>
<p>.</p>
<p></p>
</div>
<div class ="col-md-4">
<h3></h3>
<p></p>
<p></p>
</div>
</div>
</div>
</center>
</div>
<div class="socialmedia">
<nav class="menu">
<ul class="clearfix">
</ul>
</nav>
</div>
<center>
<h2></h2>
<h2></h2>
<h2></h2>
</center>
<h2></h2>
<h2></h2>
<div class="socialmedia">
<nav class="menu">
<ul class="clearfix">
<div class="allrights">
<center><li><p>Travel Away Corporation All Rights Reserved 2015</p></li></center>
</ul>
</div>
</nav>
</div>
</div>
</body>
</html>
In this image, on left side there is half side view of website and on the right side there is extra space which I want to omit. Also look at the bottom there is a bar which I don't want.
How do I remove this extra space?
css
/* CSS Document */
body{
padding:0px;
margin:0px;
background-image: url(../images/tile.jpg);
background-repeat: repeat;
}
img{
border:0px;
}
.flt{
float:left;
}
#wh_bg{
width:1000px;
margin:auto;
}
#bg_bg{
width:1000px;
float:left;
margin-left: -40px;
margin-top: -50px;
}
/*top panel starts here*/
.logo{
float:left;
margin:89px 0px 0px -15px;
position:relative;
top: 0px;
left: 0px;
}
#menu{
width:1000px;
float:left;
height:56px;
}
.men_tp{
width:900px;
float:left;
display:inline;
padding:24px 0px 0px 70px;
}
.men_tp a{
float:left;
color:#686666;
font:bold 12px/15px tahoma;
text-decoration:none;
margin-left:25px;
}
/*top panel ends here*/
/*content panel starts here*/
#content{
width:1000px;
float:left;
}
.img_txt{
float:left;
position:relative;
margin:-10px 0px 0px 10px;
}
.img_tp{
width:865px;
float:left;
background:url(../images/img_tp.gif) no-repeat;
height:15px;
}
#con{
width:865px;
float:left;
background:url(../images/part_bg.gif) repeat-y;
}
.con1{
width:560px;
float:left;
display:inline;
padding-left:4px;
padding-top:10px;
}
.con2{
width:280px;
float:left;
padding-left:20px;
display:inline;
padding-top:10px;
}
.txt{
width:560px;
float:left;
margin-top:35px;
color:#515455;
font:12px/18px georgia;
}
.wor{
float:right;
position:relative;
margin:-30px 10px 0px 0px;
}
#part2{
width:1000px;
float:left;
}
#cen{
width:640px;
float:left;
height:237px;
background:#009BD9;
}
.cont{
float:left;
margin:10px 0px 0px 0px;
}
.con_txt{
width:211px;
color:#515455;
float:left;
font:12px/16px georgia;
margin:10px 0px 0px 20px;
}
.abt_txt{
width:550px;
float:left;
margin-top:15px;
color:#FFF;
font:12px/18px georgia;
}
#link{
width:257px;
float:left;
padding:10px 0px 0px 15px;
}
.copy{
width:700px;
float:left;
margin:10px 0px 0px 200px;
color:#D4D0D0;
font:12px/18px georgia;
}
.copy a{ color:#D4D0D0; font:12px/18px georgia; }
/*footer panel ends here*/
.contecnt1
{
width:400px;
height:480px;
margin-top: 100px;
padding-top : 60px;
font-family:Candara;
font-variant:normal;
}
.imgg
{
margin-left:40px;
margin-top:-40px;
}
.imggss
{
margin-left:40px;
margin-top: -100px;
}
.para
{
text-align:justify;
color:Black;
float:left;
width:990px;
padding-left:20px;
}
.img_wrper
{
background-image:url("images/Malaysian-Flag.png");
width :990px;
height:492px;
margin-bottom:10px;
margin-top:150px;
}
.contPers
{
margin-bottom: 10px;
margin-top: 230px;
padding-right: 10px;
margin-left:65px;
}
.contPers1
{
width: 990px;
height: 800px;
margin-bottom: 10px;
margin-top: 230px;
background-color:#E6E6FA;
padding-right: 10px;
}
.contPers2
{
width: 990px;
height: 1100;
margin-bottom: 10px;
margin-top: 210px;
background-color:#E6E6FA;
padding-right: 10px;
margin-left:70px;
}
.pers
{
font-family:Candara;
font-size:18px;
padding-left:18px;
padding-top:30px;
font-weight:normal;
}
.persjbssr
{
font-family: Candara;
font-size: 18px;
padding-left: 18px;
padding-top: 30px;
font-weight: normal;
}
.pes1
{
font-family:Candara;
font-size:20px;
padding-left:18px;
font-weight:normal;
margin-left: -70px;
}
.para1
{
padding-left:18px;
font-size:15px;
font-weight:normal;
font-family:Candara;
text-align:justify;
margin-left:-70px;
width:1000px;
}
.imggs
{
margin-left:10px;
margin-right:40px;
width:100px;
}
.imggs1
{
margin-left:20px;
width:100px;
height:120px
}
.imggs2
{
margin-left:20px;
width:150px;
}
html of index file
<!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>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="js/MyMenu1.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript">
<!--
function Text_Newsletter_onclick() {
}
// -->
</script>
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<div id="headerrrr">
<ul>
<li>Home</li>
<li>About Us</li>
<li>+603 2201 1665</li>
</ul>
</div>
<div id="wh_bg">
<div id="bg_bg">
<div><img class="logo" src="images/logo.png" alt="" width="320" height="60" /></div>
<div class="social">
<ul>
<li>Connect US :</li>
<li><img src="images/fb.jpg" alt="facebook" /></li>
<li><a><img src="images/linkde.jpg" alt="facebook" /></a></li>
</ul>
</div>
<div id="menu">
<div id="wrap">
<ul class="navbar">
<li>HOME</li>
<li>ABOUT US
<ul id="Ul1">
<li><a id="A1" href="">abc</a></li>
<li>def</li>
<li>xyz</li>
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
<li><a href="">ddd/li>
</ul>
</li>
<li>eee
<ul id="Ul2">
<li><a id="A2" href="">fff</a></li>
<li><a href="">ggg/a></li>
<li>hhh</li>
</ul>
</li>
<li>iii </li>
<li></li>
<li>ghj</li>
<li>
<ul id="subnavlist">
<li class="b"><a id="subcurrent" href="#"></a>
<ul class="c">
<li class="a">A</li>
</ul>
</li>
<li>Data Collection Services</li>
<li>Editing & Proof Reading</li>
</ul>
</li>
<li id="active">CONTACT US</li>
</ul>
</div>
</div>
</div>
<div align="center"><img class="imaeslidr" src="images/Slider Animation/Slider2.gif" alt="" width="1050" height="375" /></div>
<div class="blankSeparator"> </div>
<div class="indxim" style="background-image: url(''); width: 1050px; height: 800px;">
<div class="contecntA ">
<div class="indpara">
<h2 class="hindx">About US</h2>
<p class="paraindex">Read More</a></p>
<h2 class="hindx"></h2>
<p class="paraindex"></p>
<h2 class="hindx">Research</h2>
<p class="paraindex"></p>
</div>
<div class="sidebar">
<h2 class="indxparaz">HOT LINKS</h2>
<ul class="sidebar">
<li>Up Coming Events</li>
<li>Membership</li>
<li>Registration</li>
<li>Our Personnel</li>
<li>Gallery</li>
</ul>
<br /><br />
<h2 class="indxparaz2">Our Personnel</h2>
<span class="con_txtslider"> <img src="images/personeslider.gif" alt="" /> </span></div>
</div>
</div>
<div class="blankSeparator"> </div>
<div class="footer22">
<h2 class="footerhead">Newsletter</h2>
<hr /><input id="Text1" class="footertxt" type="text" /><br /> <input id="Submit1" class="footerbutton" type="submit" value="submit" />
<div>
<h2 class="footerhead1">UpComing Events</h2>
<div class="foopara2"><a class="eventss" href="Upcomngevents.html">Events Available</a></div>
</div>
<h2 class="footerhead2">Contact Us</h2>
<div class="foopara">Call now to find out how: +603 2201 1665 <br /><br /> <a class="email" href="https://secure.ipage.com/secure/login.bml" target="_blank"> <img src="images/email-login.png" alt="signin" /> </a></div>
<br /><br /><br /><hr />
<div class="ffpara">
<p class="ffpara">© Copyright 2014, </p>
</div>
<div class="ffpara2">
<p class="ffpara2">T: E:</p>
</div>
</div>
</div>
</body>
</html>
ok i notice it where is mistake in menu bar when i remove width=140% it is fine and extra space is gone but when i add width=140% it occur extra space and also menu look like this see this link
image
menu bar code
.wrap {
width: 100%; /* Spans the width of the page */
height: 40px;
margin: 0; /* Ensures there is no space between sides of the screen and the menu */
z-index: 99; /* Makes sure that your menu remains on top of other page elements */
position: relative;
background-color: #366b82;
}
.navbar {
height: 50px;
border-right: 1px solid #54879d;
margin: 0px;
padding: 0px;
position:absolute;
margin-left:40px;
}
.navbar li {
height: auto;
width: 131px; /* Each menu item is 150px wide */
float: left; /* This lines up the menu items horizontally */
text-align: center; /* All text is placed in the center of the box */
list-style: none; /* Removes the default styling (bullets) for the list */
font: normal bold 12px/1.2em Arial, Verdana, Helvetica;
padding: 0;
margin: 0;
background-color: #366b82;
}
.navbar a {
padding: 18px 0; /* Adds a padding on the top and bottom so the text appears centered vertically */
border-left: 1px solid #54879d; /* Creates a border in a slightly lighter shade of blue than the background. Combined with the right border, this creates a nice effect. */
border-right: 1px solid #1f5065; /* Creates a border in a slightly darker shade of blue than the background. Combined with the left border, this creates a nice effect. */
text-decoration: none; /* Removes the default hyperlink styling. */
color: white; /* Text color is white */
display: block;
}
.navbar li:hover, a:hover {background-color: #54879d;}
.navbar li ul {
display: none; /* Hides the drop-down menu */
height: auto;
margin: 0; /* Aligns drop-down box underneath the menu item */
padding: 0; /* Aligns drop-down box underneath the menu item */
}
.navbar li:hover ul {
display: block; /* Displays the drop-down box when the menu item is hovered over */
}
.navbar li ul li {background-color: #54879d;}
.navbar li ul li a {
border-left: 1px solid #1f5065;
border-right: 1px solid #1f5065;
border-top: 1px solid #74a3b7;
border-bottom: 1px solid #1f5065;
}
.navbar li ul li a:hover {background-color: #366b82;}
.navbar li ul li ul li {
margin-top:-50px;
margin-left:130px;
display:block;
}
here i try to fix submenu .. when i drag cursor on menu then the image slider which is below the menu goes down..
HERE IS IMAGE 1
and when i hover mouse on menu then look like this
image2
code
/* CSS Document */
body{
padding:0px;
margin:0px;
}
img{
border:0px;
}
.flt{
float:left;
}
#wh_bg{
width:1000px;
margin:auto;
}
#bg_bg{
width:1000px;
float:left;
margin-left: -40px;
margin-top: -50px;
}
/*top panel starts here*/
#top{
width:1000px;
float:left;
}
.top1{
width:500px;
float:left;
height:176px;
display:inline;
background:url(../images/top1.jpg) no-repeat;
}
.logo{
float:left;
margin:89px 0px 0px -15px;
position:relative;
top: 0px;
left: 0px;
}
#menu{
width:1000px;
float:left;
height:56px;
}
.men_tp{
width:900px;
float:left;
display:inline;
padding:24px 0px 0px 70px;
}
.men_tp a{
float:left;
color:#686666;
font:bold 12px/15px tahoma;
text-decoration:none;
margin-left:25px;
}
.contecntA {
width: 400px;
height: 480px;
padding-top: 60px;
font-family: Candara;
font-variant: normal;
}
.contPersz {
width: 990px;
height: 900px;
margin-bottom: 10px;
margin-top: 210px;
padding-right: 10px;
margin-left:70px;
}
.imggsas
{
margin-left: 40px;
width:240%;
margin-top: -30px;
}
.img_wrperas
{
background-image:url("images/Malaysian-Flag.png");
width: 1050px;
height: 562px;
margin-bottom: 10px;
margin-top: -90px;
margin-left: 35px;
}
.corporate
{
background-image:url("images/Malaysian-Flag.png");
width: 1050px;
height: 562px;
margin-bottom: 10px;
margin-top: 80px;
margin-left: 35px;
}
.wrap {
width: 100%; /* Spans the width of the page */
height: 40px;
margin: 0; /* Ensures there is no space between sides of the screen and the menu */
z-index: 99; /* Makes sure that your menu remains on top of other page elements */
position: relative;
background-color: #366b82;
}
.navbar {
height: 50px;
border-right: 1px solid #54879d;
width: 109%;
margin: 0px;
padding: 0px;
}
.navbar li {
height: auto;
width: 131px;
/* Each menu item is 150px wide */
float: left;
/* This lines up the menu items horizontally */
text-align: center;
/* All text is placed in the center of the box */
list-style: none;
/* Removes the default styling (bullets) for the list */
font: normal bold 12px/1.2em Arial, Verdana, Helvetica;
padding: 0;
margin: 0;
background-color: #366b82;
}
.navbar a {
padding: 18px 0;
/* Adds a padding on the top and bottom so the text appears centered vertically */
border-left: 1px solid #54879d;
/* Creates a border in a slightly lighter shade of blue than the background. Combined with the right border, this creates a nice effect. */
border-right: 1px solid #1f5065;
/* Creates a border in a slightly darker shade of blue than the background. Combined with the left border, this creates a nice effect. */
text-decoration: none;
/* Removes the default hyperlink styling. */
color: white;
/* Text color is white */
display: block;
}
.navbar li:hover, a:hover {
background-color: #54879d;
}
.navbar li ul {
display: none;
/* Hides the drop-down menu */
height: auto;
margin: 0;
/* Aligns drop-down box underneath the menu item */
padding: 0;
/* Aligns drop-down box underneath the menu item */
}
.navbar li:hover ul {
display: block;
/* Displays the drop-down box when the menu item is hovered over */
}
.navbar li ul li {
background-color: #54879d;
}
.navbar li ul li a {
border-left: 1px solid #1f5065;
border-right: 1px solid #1f5065;
border-top: 1px solid #74a3b7;
border-bottom: 1px solid #1f5065;
}
.navbar li ul li a:hover {
background-color: #366b82;
}
/*i add this css code for link box*/
.navbar li ul li ul li {
margin-top:-50px;
margin-left:130px;
display:block;
}
.b:hover .a {
visibility:visible;
display:block;
}
.a {
margin-top:-5px;
visibility:hidden;
display:none;
}
.topnaviation
{
float:right;
display:inline-block;
margin-right: 400px;
}
div.topnaviationleft ul {
list-style: none outside none;
margin-left: 0px;
display:inline-block;
}
div.topnaviationleft li {
float: left;
}
.indxim
{
width:1050px;
height:800px;
margin-top: -20px;
}
.blankSeparator {
margin:10px 0;
display: block;
}
<body>
<div id="headerrrr">
<ul>
<li>Home</li>
<li>About Us</li>
<li>+603 2201 1665</li>
</ul>
</div>
<div id="wh_bg">
<div id="bg_bg">
<div><img class="logo" src="images/logo.png" alt="" width="320" height="60" /></div>
<div class="social">
<ul>
<li>Connect US :</li>
<li><img src="images/fb.jpg" alt="facebook" /></li>
<li><a><img src="images/linkde.jpg" alt="facebook" /></a></li>
</ul>
</div>
<div id="wrap">
<ul class="navbar">
<li>HOME</li>
<li>ABOUT US
<ul id="Ul1">
<li><a id="A1" href="Company_Profile.html">Company Profile</a></li>
<li>Our Philsohpy</li>
<li>CEO Profile</li>
<li>Board of Directors</li>
<li>Our People</li>
<li>Global Partnership</li>
<li>Career</li>
</ul>
</li>
<li>TRAINING
<ul id="Ul2">
<li><a id="A2" href="Academics.html">Academics</a></li>
<li>Corporate</li>
<li>Our Personnel</li>
</ul>
</li>
<li>PUBLISHING </li>
<li>CONFERENCES</li>
<li>EXHIBITION</li>
<li>RESEARCH
<ul id="subnavlist">
<li class="b"><a id="subcurrent" href="About_gjbssr.html">About GJBSSR</a>
<ul class="c">
<li class="a"> Link
</li>
</ul>
</li>
<li>Data Collection Services
</li>
<li>Editing & Proof Reading
</li>
</ul>
</li>
<li id="active">CONTACT US
</li>
</ul>
</div>
<div align="center">
<img class="imaeslidr" src="images/Slider Animation/Slider2.gif" alt="" width="1050" height="375" />
</div>
<div class="blankSeparator"> </div>
<div class="indxim" style="background-image: url('images/Malaysian-Flag.png'); width: 1050px; height: 800px;">
<div class="contecntA ">
<div class="indpara">
<h2 class="hindx">About US</h2>
<p class="paraindex"><strong>Global Academy of Training and Research</strong> is a consulting firm that offers training and research services in whole disciplinesof studies. Its goal is to provide a platform for Young Scholar, Academic & Corporate Researcher, and Trainers to discuss and frame strategies for the betterment of their goals and organization success...</p>
<h2 class="hindx">Training</h2>
<p class="paraindex"><strong>Global Academy of Training and Research</strong> offers broad range of academic and corporate Seminar programs for all public and private sector Universities and Companies. Global Academy of Training and Research goals is to uplift individual’s skills...</p>
<h2 class="hindx">Research</h2>
<p class="paraindex"><strong>Global Academy of Training and Research </strong>provides customized information and research collation to bring innovative and provocative insight into any emerging agenda for our clients. We excel in delivering insight needed to perform....</p>
</div>
<div class="sidebar">
<h2 class="indxparaz">HOT LINKS</h2>
<ul class="sidebar">
<li>Up Coming Events</li>
<li>Membership</li>
<li>Registration</li>
<li>Our Personnel</li>
<li>Gallery</li>
</ul>
<br /><br />
<h2 class="indxparaz2">Our Personnel</h2>
<span class="con_txtslider"> <img src="images/personeslider.gif" alt="" /> </span></div>
</div>
</div>
<div class="blankSeparator"> </div>
<div class="footer22">
<h2 class="footerhead">Newsletter</h2>
<hr /><input id="Text1" class="footertxt" type="text" /><br /> <input id="Submit1" class="footerbutton" type="submit" value="submit" />
<div>
<h2 class="footerhead1">UpComing Events</h2>
<div class="foopara2"><a class="eventss" href="Upcomngevents.html">Events Available</a></div>
</div>
<h2 class="footerhead2">Contact Us</h2>
<div class="foopara">Call now to find out how: +603 2201 1665 info#gatrenterprise.com</div>
<br /><br />
<div class="ffpara">
<p class="ffpara">© Copyright 2014, Global Acdemy of Training & Research</p>
</div>
<div class="ffpara2">
<p class="ffpara2">T: +603 2201 1665 E:info#gatrenterprise.com</p>
</div>
</div>
</div>
</div>
</body>
</html>
so how i fix this menu and submenu ??
Add this properties to your #headerrrr and #wrap:
Always in the top of screen:
#wrap{
position:fixed;
top:0;
}
In the top of the website:
#wrap{
absolute;
top:0;
}
I've been struggling for the entire day to center the ul list with the id="menu" vertically in this responsive layout.
Would really appreciate a hand getting in in the right place. I Want it to be centered vertically to the right. The list consists of circles indicating where you are in a one page scroll layout and also functioning as navigation.
<ul id="menu">
<li data-menuanchor="firstPage">1</li>
<li data-menuanchor="secondPage">2</li>
<li data-menuanchor="3rdPage">3</li>
<li data-menuanchor="4thpage">4</li>
</ul>
<div id="1"><p>O</p></div>
<div id="2"><p>O</p></div>
<div id="3"><p>O</p></div>
<div id="4"><p>O</p></div>
<div class="section " id="section0">
<h1>Hi</h1>
<p>Hihi</p>
</div>
<div class="section" id="section1">
<div class="slide">
<div class="intro">
<h1>Hi</h1>
<p>Hihi</p>
</div>
</div>
<div class="slide">
<div class="intro">
<h1>Simple</h1>
<p>Hihi</p>
</div>
</div>
<div class="slide">
<div class="intro">
<h1>Hey</h1>
<p>Hihi</p>
</div>
</div>
<div class="slide">
<div class="intro">
<h1>Heyhey</h1>
<p>Hihi</p>
</div>
</div>
</div>
<div class="section" id="section2">
<div class="intro">
<h1>Hi</h1>
<p>Hihi</p>
</div>
</div>
<div class="section" id="section3">
<div class="intro">
<h1>Hi</h1>
<p>Hihi</p>
</div>
</div>
This is my CSS:
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
form,fieldset,input,textarea,p,blockquote,th,td {
padding: 0;
margin: 0;
}
table {
border-spacing: 0;
}
ol,ul {
list-style: none;
margin:0;
padding:0;
}
body{
font-family: arial,helvetica;
color: #000;
color: rgba(246,192,6,1);
}
.wrap{
margin-left: auto;
margin-right: auto;
width: 960px;
position: relative;
}
h1{
font-size: 6em;
}
p{
font-size: 2em;
}
.section{
text-align:center;
}
#1 {
position: fixed;
z-index: 70;
top: 10px;
right: 10px;
}
#2 {
position: fixed;
z-index: 70;
bottom: 10px;
left: 10px;
}
#3 {
position: fixed;
z-index: 70;
top: 10px;
left: 10px;
}
#4 {
position: fixed;
z-index: 70;
bottom: 10px;
right: 10px;
}
#menu li {
display:;
margin-top: 40px;
margin-bottom: 40px;
color: #000;
background:#fff;
background: rgba(255,255,255, 0.5);
width: 35%;
height:0;
padding-bottom: 35%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
#menu li.active{
background:#000;
background: rgba(255,255,255, 1);
color: #fff;
}
#menu li a{
text-decoration:none;
color: #000;
}
#menu li.active a:hover{
color: #000;
}
#menu li:hover{
background: rgba(255,255,255, 0.8);
}
#menu li a,
#menu li.active a{
padding: 9px 18px;
display:block;
}
#menu li.active a{
color: #fff;
}
#menu{
position:fixed;
top:0;
right:0;
height: 40px;
z-index: 70;
width: auto;
padding: 0;
margin:0;
}
Here is the JSFiddle demo
Your CSS is not being applied "}" is missing from this rule.
form,fieldset,input,textarea,p,blockquote,th,td {
padding: 0;
margin: 0;
}
Numbers should not be used as a ID tag.
This is a perfect place to do vertical centering using full html5 with CSS3 transform, which will center anything vertically.
#menu {
position:fixed;
top:50%;
transform:translateY(-50%);
-webkit-transform:translateY(-50%); /* for chrome preview */
right:0;
height: auto;
z-index: 70;
width: auto;
padding: 0;
margin:0;
}
Is what you want something like this fiddle.
I added the border so that you can see the ul is aligned to the right.
You want the div numbered elements to be part of the ul. So, the first code is now:
<ul id="menu">
<li data-menuanchor="firstPage"><a href="#firstPage"><div id="1"><p>O</p></div></a </li>
<li data-menuanchor="secondPage"><div id="2"><p>O</p></div></li>
<li data-menuanchor="3rdPage"><div id="3"><p>O</p></div></li>
<li data-menuanchor="4thpage"><div id="4"><p>O</p></div></li>
</ul>
Update
Actually, what I think you want is something like this: jsfiddle.
Note the change from p to span the new class bulletDiv and the addition of vertical-align middle:
<ul id="menu">
<li data-menuanchor="firstPage"><span id="1" class="bulletDiv">O</span>1</li>
<li data-menuanchor="secondPage"><span id="2" class="bulletDiv">O</span>2</li>
<li data-menuanchor="3rdPage"><span id="3" class="bulletDiv">O</span>3</li>
<li data-menuanchor="4thpage"><span id="4" class="bulletDiv">O</span>4</li>
</ul>
CSS:
.bulletDiv{
font-size: 2em;
vertical-align:middle;
}
#menu li a{
text-decoration:none;
color: #000;
vertical-align:middle;
}