I have a little issue with styling my asp.net page :
in the top of the my aspx page I declared :
<head>
<meta charset="utf-8">
<title>CSS3 Menu - Impressionist UI - by Valeriu Timbuc for Design Modo</title>
<link rel="stylesheet" href="css/style.css" media="screen">
<style type="text/css">
html, body { margin: 0; padding: 0; }
body { margin: 5px; background: #f2f2f2 no-repeat top center; }
ul.menu { margin: 5px auto 0 auto; }
</style>
<meta name="robots" content="noindex,follow" />
</head>
In some place I have this code :
<div class="rounded-corners"; style=" margin-left:50px; margin-right:50px; ">
<asp:GridView id="MyGridView"
DataSourceID="MyDataSource1"
AutoGenerateColumns="False"
GridLines="Both"
AllowSorting="True"
AllowPaging="True"
CssClass="mGrid"
PagerStyle-CssClass="pgr"
AlternatingRowStyle-CssClass="alt"
Runat="Server" PageSize="35">
<columns>
<asp:boundfield datafield="FICHIER"
readonly="true"
headertext="Fichier"
ItemStyle-CssClass="CellFile">
</asp:boundfield>
In this latter I tried to use the ItemStyle-CssClass="CellFile" in irder to define a padding-left and a color. So in my css file I Have :
/* Reset */
.menu,
.menu ul,
.menu li,
.menu a {
margin: 0;
padding: 0;
border: none;
outline: none;
padding-bottom:10px;
}
/* Menu */
.menu {
height: 40px;
width: 468px;
background: #4c4e5a;
background: -webkit-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -moz-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -o-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -ms-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: #4c4e5a;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.menu li {
position: relative;
list-style: none;
float: left;
display: block;
height: 26px;
text-align:center;
top: 3px;
left: -2px;
}
/* Links */
.menu li a {
display: block;
padding: 0 14px;
margin: 6px 0;
line-height: 28px;
text-decoration: none;
border-left: 1px solid #393942;
border-right: 1px solid #4f5058;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
color: #f3f3f3;
text-shadow: 1px 1px 1px rgba(0,0,0,.6);
-webkit-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
-ms-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
}
.menu li:first-child a { border-left: none; }
.menu li:last-child a{ border-right: none; }
.menu li:hover > a { color: #8fde62; }
/* Sub Menu */
.menu ul {
position: absolute;
top: 40px;
left: 0;
opacity: 0;
background: #1f2024;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
-webkit-transition: opacity .25s ease .1s;
-moz-transition: opacity .25s ease .1s;
-o-transition: opacity .25s ease .1s;
-ms-transition: opacity .25s ease .1s;
transition: opacity .25s ease .1s;
}
.menu li:hover > ul { opacity: 1; }
.menu ul li {
height: 28px;
overflow: hidden;
padding: 0;
-webkit-transition: height .25s ease .1s;
-moz-transition: height .25s ease .1s;
-o-transition: height .25s ease .1s;
-ms-transition: height .25s ease .1s;
transition: height .25s ease .1s;
top: 0px;
left: 0px;
width: 205px;
}
.menu li:hover > ul li {
height: 36px;
overflow: visible;
padding: 0;
}
.menu ul li a {
width: 125px;
padding: 4px 0 4px 40px;
margin: 0;
text-align:inherit;
border: none;
border-bottom: 1px solid #353539;
}
.menu ul li:last-child a { border: none; }
/* Icons */
.menu a.documents { background: url(../img/docs.png) no-repeat 0px center; width: 125px;}
.menu a.messages { background: url(../img/bubble.png) no-repeat 0px center; width: 125px;}
.menu a.signout { background: url(../img/arrow.png) no-repeat 0px center; width: 125px;}
.mGrid {
width: 100%;
background-color: #fff;
margin: 5px 0 10px 0;
border: solid 1px #525252;
border-collapse:collapse;
border-radius: 0 0 5px 5px;
}
.mGrid td {
padding: 2px;
border: solid 1px #c1c1c1;
color: #717171;
}
.mGrid th
{
/*padding: 4px 2px; */
color: #fff;
background: #4c4e5a;
background: #424242 url(../img/grd_head.png) repeat-x top;
background: -webkit-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -moz-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -o-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -ms-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: #4c4e5a;
font-size: 1.2em;
font-variant:small-caps;
text-align : left;
padding-left: 15px;
font-family: Cambria;
}
.mGrid .alt { background: #fcfcfc url(../img/grd_alt.png) repeat-x top; }
.mGrid .pgr { border: 1px solid #424242; background: #424242 url(../img/grd_pgr.png) repeat-x top; }
.mGrid .pgr table { margin: 5px 0; }
.mGrid .pgr td {
border-width: 0;
padding: 0 6px;
border-left: solid 1px #666;
font-weight: bold;
color: #fff;
line-height: 12px;
}
.mGrid .pgr a
{
color: #58ae1b;
text-decoration: none;
background: #4c4e5a;
background: #424242 url(../img/grd_head.png) repeat-x top;
background: -webkit-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -moz-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -o-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -ms-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: #4c4e5a;
}
.mGrid .pgr a:hover { color: #000; text-decoration: none; }
.rnd1 {
background-color: #f0ff00;
height: 1px;
}
.gv1 {
width: 100%;
border: 0px none;
}
.gv1 th {
background-color: #C1C4D0;
}
.rounded-corners {
border: 1px solid #424242;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
text-decoration: none;
background: #424242;
background: -webkit-linear-gradient(top, #424242 0%,#2c2d33 100%);
background: -moz-linear-gradient(top, #424242 0%,#2c2d33 100%);
background: -o-linear-gradient(top, #424242 0%,#2c2d33 100%);
background: -ms-linear-gradient(top, #424242 0%,#2c2d33 100%);
background: #424242;
}
.CellFile
{
padding-left:100px;
color:Aqua;
}
So When I Run the style won't apply but when I delete the <head></head> part the style works fine. I m new to css and asp.net and I guess the prob is somewhere in the styling declaration. How could I make it Work ?
Thank you.
does it make a difference if you make it a self-closing tag?
<asp:BoundField ItemStyle-CssClass="CellFile" />
if not, you might have to make it a template field.
Related
The drop-down menu works fine on my theme but just have little problem for last-child submenu like about fix the text position cannot move to top nearby another submenu and about how to remove transparency background for last child submenu like my concept below:
css for drop-down menu
.navbar-default {
box-shadow: 0 2px 10px rgba(0,0,0,0.67);
background: #fff;
background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zd…IxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjdG9wVG9Cb3R0b21HcmFkaWVudCkiLz48L3N2Zz4=);
background: -moz-linear-gradient(top, #fff 0, #e6e6e6 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(100%, #e6e6e6));
background: -webkit-linear-gradient(top, #fff 0, #e6e6e6 100%);
background: -o-linear-gradient(top, #fff 0, #e6e6e6 100%);
background: -ms-linear-gradient(top, #fff 0, #e6e6e6 100%);
background: linear-gradient(to bottom, #fff 0, #e6e6e6 100%);
width: 100%;
height: 44px;
border-width: 0 0 1px;
border-style: solid;
border-color: #fff;
position: relative;
margin-top: 5px;
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border-color: #e7e7e7;
position: relative;
z-index: 20;
}
.navbar-nav {
background: url(img/logo.png) no-repeat scroll right/ 91% 100%;
z-index: 0;
position: absolute;
left: 0;
right: 0;
height: 0
}
.navbar-nav a {
display: block;
}
.navbar-nav li {
display: block;
/* margin: 0 47%; */
padding: 0;
/* width: 180px; */
/* height: 138px; */
/* text-indent: -999em; */
direction: ltr;
float: none;
}
.navbar-nav li:hover .dropdown-menu {
opacity: 1;
top: 105px;
visibility: visible;
}
.navbar-default .navbar-nav>li>a {
color: transparent;
background: url(img/logo.png) no-repeat scroll right/ 91% 100%;
display: block;
margin: -33px auto 0 auto;
width: 180px;
height: 150px;
/* text-indent: -999em; */
direction: ltr;
float: none;
}
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus {
background: url(img/logo.png) no-repeat scroll right/ 91% 100%;
color: transparent;
display: block;
margin: -33px auto 0 auto;
width: 180px;
height: 150px;
direction: ltr;
float: none;
}
.navbar-default .navbar-nav>li>a:hover, .navbar-default .navbar-nav>li>a:focus {
color: transparent;
}
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus {
background: url(img/logo.png) no-repeat scroll right/ 91% 100%;
color: transparent;
display: block;
margin: -33px auto 0 auto;
width: 180px;
height: 150px;
direction: ltr;
float: none;
}
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:hover, .navbar-default .navbar-nav>.active>a:focus {
color: transparent;
background-color: transparent;
}
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus {
background: url(img/logo.png) no-repeat scroll right/ 91% 100%;
color: transparent;
display: block;
margin: -33px auto 0 auto;
width: 180px;
height: 150px;
direction: ltr;
float: none;
}
.navbar-nav ul {
}
.nav .open>a, .nav .open>a:hover, .nav .open>a:focus {
/* background-color: #eeeeee; */
border-color: #337ab7;
}
.navbar-nav>li>.dropdown-menu {
margin: -1px 0 0 45%;
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.dropdown-menu {
/* background: url(img/submenu.png) no-repeat scroll right/ 91% 100%; */
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 153px;
padding: 1px 0;
margin: 2px 0 0 0;
list-style: none;
font-size: 14px;
text-align: center;
background-color: #5c4d4a;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,0.175);
box-shadow: 0 6px 12px rgba(0,0,0,0.175);
background-clip: padding-box;
opacity: 0;
top: 35px;
visibility: hidden;
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
.dropdown-menu li a {
display: block;
background: url(img/submenu.png) no-repeat scroll right/ 104% 108%;
padding: 10px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571;
color: #fff;
white-space: nowrap;
}
.dropdown-menu li a:hover,
.dropdown-menu li a:focus {
background: url(img/submenu.png) no-repeat scroll right/ 104% 108%;
color: #ccc;
text-decoration: none;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
.dropdown-menu li:last-child a {
display: block;
background: url(img/submenu.png) no-repeat scroll right/ 104% 108%;
padding: 10px 20px;
clear: both;
font-weight: normal;
line-height: 1.428571;
color: #fff;
white-space: nowrap;
}
.dropdown-menu li:last-child a:hover,
.dropdown-menu li:last-child a:focus
{
color: #000;
text-decoration: none;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
-webkit-transition: all .25s ease;
-moz-transition: all .25s ease;
-ms-transition: all .25s ease;
-o-transition: all .25s ease;
transition: all .25s ease;
}
.dropdown-menu ul {
list-style: none;
}
For further info you can check out my theme. Thanks before.
If you want to put text on top you can change your .dropdown-menu li:last-child a to something like:
.dropdown-menu li:last-child a {
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 52px;
}
If you want to remove transparent background but you have menu shadow in .dropdown-menu must add this rules at the bottom:
.dropdown-menu {
...
border-bottom-right-radius: 77px;
border-bottom-left-radius: 77px;
}
change
.dropdown-menu li:last-child a {
padding: 31px 20px;
}
to
.dropdown-menu li:last-child a {
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 70px;
}
to get the desired effect you can just:
.dropdown-menu li:last-child a {
padding: 8px 20px 62px 20px
}
This is a structure of my site:
<html>
<body>
<embed flash>
<div id='dialog'>
<div width="500px" height="300px"><iframe/></div>
</div>
</body>
</html>
<style type="text/css">
.hide { display: none; }
.show { display: block; }
iframe { border: 0; }
#dialog { background-color: rgba(0,0,0,0.5); position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; }
#dialog .dialog-inside { width: 650px; -webkit-box-shadow: 0px 0px 30px 0px rgba(50, 50, 50, 0.54); -moz-box-shadow: 0px 0px 30px 0px rgba(50, 50, 50, 0.54); box-shadow: 0px 0px 30px 0px rgba(50, 50, 50, 0.54); margin: auto; overflow: hidden; border-radius: 5px; }
#dialog .dialog-inside .dialog-header { position: absolute; right: 0; right: 1px; top: 3px; }
#dialog .dialog-inside .dialog-header .close { width: 23px; height: 23px; background: url("Images/close.png"); background-position: 2px 2px; background-repeat: no-repeat; border: 1px solid transparent; cursor: pointer; }
#dialog .dialog-inside .dialog-header .close:hover { background-color: #fdc985; border-color: #4040B1; }
#dialog .dialog-inside .dialog-bottom-wrapper { position: absolute; bottom: 0px; right: 0; left: 0; height: 42px; background-color: #f8f8f8; }
#dialog .dialog-inside .dialog-bottom-wrapper .dialog-bottom { float: right; margin: 8px 5px; }
#dialog .dialog-inside .dialog-bottom-wrapper .dialog-bottom .btn { background: rgb(251,251,249); /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZiZmJmOSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmM2YzZWYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, rgba(251,251,249,1) 0%, rgba(243,243,239,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(251,251,249,1)), color-stop(100%,rgba(243,243,239,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fbfbf9', endColorstr='#f3f3ef',GradientType=0 ); /* IE6-8 */ border: 1px solid #7f9db9; color: #333333; cursor: pointer; display: inline-block; margin-left: .5em; padding: 0px 12px; text-align: center; line-height: 20px; outline: none; border-radius: 3px; }
#dialog .dialog-inside .dialog-bottom-wrapper .dialog-bottom .btn:hover { background-color: #d1d1d1; border-color: #d1d1d1; color: #111; moz-transition: background-position 0.1s linear; ms-transition: background-position 0.1s linear; o-transition: background-position 0.1s linear; text-decoration: none; transition: background-position 0.1s linear; webkit-transition: background-position 0.1s linear; outline: none; }
#dialog iframe { display: block; height: 114px; }
</style>
The problem is dialog I set it position: absolute, left, top, bottom, right: 0, in Chrome, IE work fine, it's rendered full screen with black background. Opera, the dialog has width and height is fix with div child => it doesn't have fullscreen. In firefox, it like the same, but I hover on dialog in Inspect Mode, it show black background.
Anyone has the problem like that?
Try adding
height: 100%;
width: 100%;
on #dialog
How do I stop the text in my webpage from breaking to the next line. Its a navigation bar.
I tried both: 'whitespace: nowrap;' and 'overflow: hidden;' which gives me this result:
. The text doesn't break to the next line, but the drop down menus don't work and the text 'Arc Studios' is cut off on the top and bottom.
How do I stop the text from breaking to the next line, while still keeping all of the functions (drop-down menus, and the 'Arc Studios' text)?
CSS
p {
text-align: justify;
color: #000000;
text-indent:5px;
}
body {
background: #f5f5f5;
background-image: url('brushed.png');
}
footer {
background: rgb(63,76,107); /* Old browsers */
background: -moz-linear-gradient(top, rgba(63,76,107,1) 0%, rgba(63,76,107,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(63,76,107,1)), color-stop(100%,rgba(63,76,107,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3f4c6b', endColorstr='#3f4c6b',GradientType=0 ); /* IE6-9 */
box-shadow: 0px 1px 3px #000000;
border-radius: 0px;
text-indent: 5px;
position: absolute; right: 0; left: 0;
margin-top: 100px;
}
.menu,
.menu ul,
.menu li,
.menu a {
margin: 0;
padding: 0;
border: none;
outline: none;
overflow: hidden;
white-space: nowrap;
}
.menu {
margin-top: -8px;
height: 50px;
width: 100%;
position: absolute; right: 0; left: 0;
text-align: left;
background: rgb(63,76,107); /* Old browsers */
background: -moz-linear-gradient(top, rgba(63,76,107,1) 0%, rgba(63,76,107,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(63,76,107,1)), color-stop(100%,rgba(63,76,107,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(63,76,107,1) 0%,rgba(63,76,107,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3f4c6b', endColorstr='#3f4c6b',GradientType=0 ); /* IE6-9 */
box-shadow: 0px 1px 3px #000000;
-webkit-border-radius: 1px;
-moz-border-radius: 1px;
border-radius: 1px;
}
.menu li {
position: relative;
list-style: none;
float: left;
display: block;
height: 40px;
}
.menu li a { /* Navigation Bar text */
display: block;
padding: 0 20px;
margin: 15px 0;
line-height: 15px;
text-decoration: none;
font-family: sans-serif;
font-weight: bold;
font-size: 12px;
color: red;
/* text-shadow: 1px 1px 1px rgba(255,255,255,0.3); */
-webkit-transition: color .4s ease-in-out;
-moz-transition: color .4s ease-in-out;
-o-transition: color .4s ease-in-out;
-ms-transition: color .4s ease-in-out;
transition: color .4s ease-in-out;
}
.menu li:first-child a{ border-left: none; }
.menu li:last-child a{ border-right: none; }
.menu li:hover > a { text-decoration: underline; }
.menu li#navbar-logo:hover > a { text-decoration: none; }
.menu ul {
position: absolute;
top: 35px;
left: 0;
opacity: 0;
background: rgba(63,76,107,1);
border-left: 1px solid #393942;
border-bottom: 1px solid #393942;
border-right: 1px solid #393942;
-webkit-border-radius: 0 0 2px 2px;
-moz-border-radius: 0 0 2px 2px;
border-radius: 0 0 2px 2px;
-webkit-transition: opacity .75s ease .1s;
-moz-transition: opacity .75s ease .1s;
-o-transition: opacity .75s ease .1s;
-ms-transition: opacity .75s ease .1s;
transition: opacity .75s ease .1s;
}
.menu li:hover > ul {
opacity: 1;
}
.menu ul li {
height: 0;
overflow: hidden;
padding: 0;
-webkit-transition: height .25s ease .1s;
-moz-transition: height .25s ease .1s;
-o-transition: height .25s ease .1s;
-ms-transition: height .25s ease .1s;
transition: height .25s ease .1s;
}
.menu li:hover > ul li {
height: 35px;
overflow: visible;
padding: 0;
}
.menu ul li a {
width: 100px;
padding: 10px 0 10px 10px;
margin: 0;
border: none;
border-bottom: 1px solid #353539;
}
.menu ul li:last-child a {
border: none;
}
.menu li#navbar-logo,
.menu li#navbar-about,
.menu li#navbar-shop,
.menu li#navbar-contact,
.menu li#navbar-community {
margin-top: 5px;
}
.menu li#navbar-logo {
margin-top: 3px;
}
.menu li#navbar-logo,
.menu li#navbar-about,
.menu li#navbar-shop,
.menu li#navbar-contact,
.menu li#navbar-community {
margin-left: -13px;
margin-right: 5px;
}
.menu li#navbar-about,
.menu li#navbar-shop,
.menu li#navbar-contact,
.menu li#navbar-community {
margin-left: 5px;
margin-right: 5px;
}
#navbar-logo a{
color: #FFC8C8;
text-shadow: 2px 2px 2px rgba(255, 0, 0, 1);
font-size: 50px;
font-family: Intrique Script Personal Use;
}
HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Title of Webpage</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<header>
<nav class="navbar">
<ul class="menu">
<li id="navbar-logo">Arc Studios</li>
<li id="navbar-about">About Us
<ul>
<li>FAQ's</li>
<li>Our Inception</li>
<li>Locations</li>
</ul>
</li>
<li id="navbar-shop">Store
<ul>
<li>Games</li>
<li>OS's</li>
<li>Other</li>
</ul>
</li>
<li id="navbar-contact">Contact
<ul>
<li>Email</li>
<li>Help Centre</li>
</ul>
</li>
<li id="navbar-community">Community
<ul>
<li>Forums</li>
<li>Events</li>
</ul>
</li>
</ul>
</nav>
</header>
<br></br>
<footer class="footer">
<p><small>© Copyright 2013, All rights reserved</small></p>
</footer>
</body>
</html>
I'm new to HTML, excuse me.
You would need to decrease the padding in the .menu li a style as they are still block type elements, and specifying white-space: nowrap; will not make a difference, because the menu items are split between the li's.
Remove the overflow:hidden; to show the entire logo.
As for the wrapping, if you don't want any collapsing, you need to set a min-width or a fixed width on ul.menu.
Otherwise, you could use media queries to adjust the sizing of the menu links at certain breakpoints.
I'm Having Trouble with my Web Page: There is no bottom padding and it makes my website look weird. I have tried changing the body, and html to margin-bottom: 100px but it does not seem to work. This always seems to happen when I add outsourced navigation bars.
CSS
#charset "utf-8";
/* CSS Document */
html, body { margin: 0; padding:0px;}
body { margin: 5px; background: #f2f2f2; }
ul.menu { margin: 50px auto 0 auto; }
.menu,
.menu ul,
.menu li,
.menu a {
margin: 0;
padding: 0;
border: none;
outline: none;
}
/* Menu */
.menu {
height: 40px;
width: 905px;
background: #4c4e5a;
background: -webkit-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -moz-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -o-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: -ms-linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
background: linear-gradient(top, #4c4e5a 0%,#2c2d33 100%);
border:#8fde62 medium solid;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.menu li {
position: relative;
list-style: none;
float:left;
display: block;
height: 40px;
}
/* Links */
.menu li a {
display: block;
padding: 0 14px;
margin: 6px 0;
line-height: 28px;
text-decoration: none;
border-left: 1px solid #393942;
border-right: 1px solid #4f5058;
font-family: Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 13px;
color: #f3f3f3;
text-shadow: 1px 1px 1px rgba(0,0,0,.6);
-webkit-transition: color .2s ease-in-out;
-moz-transition: color .2s ease-in-out;
-o-transition: color .2s ease-in-out;
-ms-transition: color .2s ease-in-out;
transition: color .2s ease-in-out;
}
.menu li:first-child a { border-left: none; }
.menu li:last-child a{ border-right: none; }
.menu li:hover > a { color: #8fde62; }
/* Sub Menu */
.menu ul {
position: absolute;
top: 40px;
left: 0;
opacity: 0;
background: #1f2024;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
-webkit-transition: opacity .25s ease .1s;
-moz-transition: opacity .25s ease .1s;
-o-transition: opacity .25s ease .1s;
-ms-transition: opacity .25s ease .1s;
transition: opacity .25s ease .1s;
}
.menu li:hover > ul { opacity: 1; }
.menu ul li {
height: 0;
overflow: hidden;
padding: 0;
-webkit-transition: height .25s ease .1s;
-moz-transition: height .25s ease .1s;
-o-transition: height .25s ease .1s;
-ms-transition: height .25s ease .1s;
transition: height .25s ease .1s;
}
.menu li:hover > ul li {
height: 36px;
overflow: visible;
padding: 0;
}
.menu ul li a {
width: 100px;
padding: 4px 0 4px 40px;
margin: 0;
border: none;
border-bottom: 1px solid #353539;
}
.menu ul li:last-child a { border: none; }
#wrapper{
width:900px;
height:auto;
margin: 50px auto 0 auto;
}
#xboxcard{
width:300px;
height:500px;
background-color:#4c4e5a;
border:#8fde62 medium solid;
border-radius:5px;
}
#rightcontent{
width:575px;
height:342px;
background-color:#4c4e5a;
border:#8fde62 medium solid;
border-radius:5px;
float:right;
padding: 10px 10px 10px 10px;
position:absolute;
top:150px;
left:495px;
text-align:center;
color:#FFF;
}
#step1{
width:245px;
height:250px;
position:absolute;
top:550px;
left:180px;
text-align:center;
color:#FFF;
padding: 10px 10px 10px 10px;
background-color:#4c4e5a;
border:#8fde62 medium solid;
}
HTML
<body>
<ul class="menu">
<li>Home</li>
<li>Contact</li>
<li>Claim</li>
<li>Proof</li>
</ul> <!-- end .menu -->
<div id="wrapper">
<img src="#" alt="#" height="342" width="245" style=" background-color:#4c4e5a;
border:#8fde62 medium solid;
border-radius:5px;
padding:10px 10px 10px 10px;
" />
<div id="rightcontent">
<h1>This is Some right content!</h1>
</div>
<div id="step1">
</div>
</div>
</body>
</html>
try to add this your css...
#wrapper {
margin-bottom:50px;
}
or however many pixels you want the bottom margin to have
Did you try adding padding to the body element?
body{
padding-bottom: 100px;
}
Hey I setup a jsfiddle for your code to take a look, I tweaked some things, check it out and see what you find useful: http://jsfiddle.net/cVLqu/
Biggest recommendation here is:
position: relative;
on the wrapper and the boxes inside it, that way they expand the wrapper instead of floating around freely.
Also check out this post on css-tricks.com, I found it really helpful:
http://css-tricks.com/dont-overthink-it-grids/
All,
I am trying to build a top menu. For some reason, the li elements are not starting from the top of ul, there appears to be a small margin left at the top. Any explanation please.
jsfiddle: http://jsfiddle.net/K26TN/
HTML Code:
<div id="menu_bars">
<div id="main_bar">
<ul>
<li id="overview_tab" class="maintabs"><a id="text_overview_tab">Overview</a></li><li id="collar_tab" class="maintabs"><a id="text_collar_tab">Collar/ Neckline</a></li><li class="maintabs" id="body_tab"><a id="text_body_tab" >Body</a></li><li id="sleeves_tab" class="maintabs"><a id="text_sleeves_tab" >Sleeves</a></li>
</ul>
</div>
</div>
CSS CODE:
html {
height: 100%;
}
body#container {
position: relative;
width: 100%
min-width: 1280px;
height: 100%;
min-height: 700px;
background-color: rgba(255,255,255,0.8);
margin: 0 auto;
}
#menu_bars {
position: relative;
width: 90%;
height: 20%;
margin: 0 auto;
}
#main_bar {
float: left;
width: 78%;
height: 100%;
}
#main_bar ul {
float: left;
width: 100%;
height: 100%;
border-radius: 6px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2);
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.maintabs {
display: inline-block;
width: 25%;
height: 100%;
list-style-type: none;
cursor: pointer;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(255,255,255)), color-stop(100%,rgb(237,237,237))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgb(255,255,255) 0%,rgb(237,237,237) 100%); /* Chrome10+,Safari5.1+ */
background: linear-gradient(top, rgb(255,255,255) 0%,rgb(237,237,237) 100%); /* W3C */
}
.maintabs:first-child {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px; }
.maintabs:last-child {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
.maintabs a {
display: block;
height: 100%;
color: rgb(125,125,125);
line-height: 100%;
font-size: 0.8em;
text-decoration: none;
text-align: center;
text-shadow: 0px 1px 2px rgba(150,150,150,0.4);
-moz-transition: all 0.3s ease-in;
-webkit-transition: all 0.3s ease-in;
-o-transition: all 0.3s ease-in;
transition: all 0.3s ease-in;
}
#overview_tab a{
color: rgb(142,101,143);
text-shadow: 0px 1px 1px rgba(248,248,248,1);
}
.maintabs a:hover {
color: rgb(153,112,154);
text-shadow: 1px 1px 0 rgba(255,255,255,0.95);
}
Your <li> elements are set to display: inline-block, but their vertical-align property defaults to baseline. Specify this in your CSS:
#main_bar li {vertical-align: top}