horizontal css navigation problem - html

Hello not sure why but having some problem with a navigation. It seems to be overflowing and if I fix it in one browser it fails in the other. So I am not sure what is wrong with it. Recently the CSS broke and the entire menu is beyond messed up.
any ways heres is the site http://www.otaku-plus.com/triton
EDITED: updated code bit: http://jsfiddle.net/yukimura/hqyY2/embedded/result/
here is the css bit for the menu
#dropfish {
background-attachment: scroll;
background-clip: border-box;
background: #111111 url("images/top-bar-bg.png");
background-origin: padding-box;
background-position: 0% 0%;
background-repeat: repeat-x;
background-size: auto;
color: #000000;
left: 0px;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px;
top: 0px;
width: 100%;
height: 44px;
position: fixed;
z-index: 9999;
box-shadow:0px 1px 2px;
}
#dropfish_menu {
width: 90%;
height: 44px;
margin: 0 auto;
}
#dropfish_menu ul {
width: 90%;
height: 44px;
}
#dropfish_menu ul li {
float: left;
padding: 14px 0px;
margin-top: -1px;
}
#dropfish_menu a {
color: #ffffff;
text-shadow:0 -1px 0 #000000;
padding: 14px 16px;
font-size: 14px;
}
#dropfish_menu a:hover {
margin-top: 0px;
padding: 14px 16px;
/* background-color:#cdcdcd; */
background-repeat: repeat;
background-color: #313131;
background-image: url("images/top-bar-bg.png");
background-position: 50% 75%;
cursor: pointer;
}
.active {
background-color: #313131;
background-image: url("images/top-bar-bg.png");
background-position: 50% 75%;
}
html bit for the menu
<div id="dropfish">
<div id="dropfish_menu">
<ul>
<div style="float:left;margin-left:-128px;">
<li><img src="http://opcdn.otaku-plus.com/themes/plus/images/logo.png" height="34px" style="margin-top: -8px;margin-right: 8px; cursor: pointer;" id="phx_return_logo"/></li>
<li>Web</li>
<li>Anime</li>
<li>Manga</li>
<li>News</li>
<li>Events</li>
<li>More</li>
</div>
<div style="float:right;margin-right:-128px;">
<li>Register</li><li>Sign in</li><li>Preferences</li>
</div>
</ul>
</div>
</div>
can some one tell me what is wrong with my CSS? or HTML

I made a possible solution to your problem. See this
#mainNav is floating left and #login is floating right.
I adjusted your mark up.

Related

Html wrap div full width

I have an HTML page with a div containing another div that contains all users in a database (chat system) however the ul li tag is not taking the full width of the parent div. This is an image of the expected outcome: http://prntscr.com/nz6byp
I already tried setting the width to 100%.
HTML
.left-sidebar{
background-color:#F7F7F7;
padding: 20px;
border-radius: 5px 0px 0px 5px;
}
.searchbox{
padding:20px 10px;
width: 100%;
}
.input-group-btn{
margin: auto;
}
.search-icon{
margin: auto;
font-size: 14px;
background-size: 250%;
background-image: linear-gradient(to right, #77A1D3 0%, #79CBCA 51%, #77A1D3 100%);
transition: background 0.5s ease-out;
color:#fff;
}
.search-icon:hover{
background-position: right center;
color: #fff;
}
.form-control:focus{
border:2px solid #fff;
}
.chat-left-img,.chat-left-detail{
float: left;
}
.left-chat{
overflow-y: scroll;
width: 100%;
}
.left-chat::-webkit-scrollbar-track
{
}
.left-chat::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
}
.left-chat::-webkit-scrollbar-thumb
{
border-radius: 5px;
/*-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);*/
background-color: #DEDEDE;
}
.left-chat ul{
overflow: hidden;
padding: 0px;
}
.left-chat ul li{
list-style: none;
width:100%;
float: left;
padding: 5px;
margin: auto;
background-color: #F2F2F2;
border-radius: 0px;
transition: background 0.25s ease-out;
}
.left-chat ul li:hover{
background-color: #E2E2E2
}
.chat-left-img img{
width:50px;
height:50px;
border-radius: 50%;
text-align: left;
float:fixed;
padding: 3px;
background: linear-gradient(to right, #77A1D3 0%, #79CBCA 51%, #77A1D3 100%);
background-size: 250%;
}
.chat-left-details{
width: 100%;
}
.chat-left-details a{
margin: 5%;
text-decoration: none;
color: #5D5C5C;
font-weight: 200;
}
.online{
margin: 5%;
color:#86BB71;
font-size: 14px;
}
.offline{
margin: 5%;
color:#C6C4C4;
font-size: 14px;
}
<div class="col-md-3 col-sm-3 col-cs-12 left-sidebar">
<div class="input-group searchbox">
<div class="input-group-btn">
<center><button id="" class="btn btn-default search-icon" name="search_user" type="submit">Add new user</button></center>
</div>
</div>
<div class="left-chat">
<ul>
<li>
<div class='chat-left-img'> <img src='$user_profilepic'>
</div>
<div class='chat-left-details'>
<a href='home.php?user_name=$user_name'>$user_name</a>
<span style='font-size: 12px; color: #5D5C5C;'>(You)
</span><br>
</div>
</li>
</ul>
</div>
Any help is appreciated!
The list elements' width is set to 100% of container, but container has padding, thats why you think it's not filled the container.
.left-sidebar has padding: 20px;, and also .left-chat has overflow-y: scroll. these two rules makes element smaller than you expect (some for parent padding, some for scrollbar width).
you can padding: 0 for .left-sidebar and set overflow-y: auto for .left-chat.
Also you can inspect elements on chrome dev tools, to see whats going on.
you can see this here: codepen
Your .left-sidebar has a 20px padding.
I removed left and right padding and now the list take full width
.left-sidebar{
background-color:#F7F7F7;
padding: 20px;
border-radius: 5px 0px 0px 5px;
}
.left-sidebar{
background-color:#F7F7F7;
padding: 20px 0;
border-radius: 5px 0 0 5px;
}
.searchbox{
padding:20px 10px;
width: 100%;
}
.input-group-btn{
margin: auto;
}
.search-icon{
margin: auto;
font-size: 14px;
background-size: 250%;
background-image: linear-gradient(to right, #77A1D3 0%, #79CBCA 51%, #77A1D3 100%);
transition: background 0.5s ease-out;
color:#fff;
}
.search-icon:hover{
background-position: right center;
color: #fff;
}
.form-control:focus{
border:2px solid #fff;
}
.chat-left-img,.chat-left-detail{
float: left;
}
.left-chat{
overflow-y: auto;
width: 100%;
}
.left-chat::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
}
.left-chat::-webkit-scrollbar-thumb
{
border-radius: 5px;
/*-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);*/
background-color: #DEDEDE;
}
.left-chat ul{
overflow: hidden;
padding: 0px;
}
.left-chat ul li{
list-style: none;
width:100%;
float: left;
padding: 5px;
background-color: #F2F2F2;
border-radius: 0px;
transition: background 0.25s ease-out;
}
.left-chat ul li:hover{
background-color: #E2E2E2
}
.chat-left-img img{
width:50px;
height:50px;
border-radius: 50%;
text-align: left;
float:fixed;
padding: 3px;
background: linear-gradient(to right, #77A1D3 0%, #79CBCA 51%, #77A1D3 100%);
background-size: 250%;
}
.chat-left-details{
width: 100%;
}
.chat-left-details a{
margin: 5%;
text-decoration: none;
color: #5D5C5C;
font-weight: 200;
}
<div class="col-md-3 col-sm-3 col-cs-12 left-sidebar">
<div class="input-group searchbox">
<div class="input-group-btn">
<center><button id="" class="btn btn-default search-icon" name="search_user" type="submit">Add new user</button></center>
</div>
</div>
<div class="left-chat">
<ul class="full-width-no-padding">
<li class="full-width-no-padding">
<div class='chat-left-img'> <img src='$user_profilepic'>
</div>
<div class='chat-left-details'>
<a href='home.php?user_name=$user_name'>$user_name</a>
<span style='font-size: 12px; color: #5D5C5C;'>(You)
</span><br>
</div>
</li>
</ul>
</div>
EDIT
As #yaya pro suggested i added overflow-y: auto; to .left-chat class

How to hide text in menu on hover and put image with underline instead?

I want to make menu on top, and on hover mouse to hide text and display icon. And to add underline under icon.In my code i successfully change text to image but how to add underline under image and make underline 3px wight and 60px length?
There is my code- HTML:
<div class="menu topMenu">
<ul class="topMenuOptions">
<li><span>111</span></li>
<li><span>222</span></li>
<li><span>333</span></li>
</ul>
CSS:
.topMenu {
text-transform: uppercase;
background-image: url('images/1.png');
position: absolute;
height: 88px;
width: 400px;
background: lightcoral;
margin-left: 332px;
padding-top: 30px;
}
.topMenuOptions {
padding: 0;
margin: 0;
margin-left: 155px;
list-style-type: none;
}
.topMenuOptions li {
cursor: pointer;
padding: 10px;
color: white;
font-size: 14px;
display: inline;
}
.topMenuOptions li:hover:nth-child(1) {
background: url('images/2.png') center center no-repeat;
background-position: 20px 0;
background-size: contain;
color:transparent;
}
.topMenuOptions li:hover:nth-child(2) {
background: url('images/3.png') center center no-repeat;
background-size: contain;
background-position: 20px 0;
color: transparent;
}
.topMenuOptions li:hover:nth-child(3) {
background: url('images/4.png') center center no-repeat;
background-size: contain;
background-position: 20px 0;
color: transparent;
}
Use border-bottom: 3px solid white;, for example:
.topMenuOptions li:hover:nth-child(1) {
background: url('images/2.png') center center no-repeat;
background-position: 20px 0;
background-size: contain;
color:transparent;
border-bottom: 3px solid #fff;
}
As per your requirement, I made a fiddle which you can check.
for the underline, you can keep border-bottom of 3px with border-color initially as transparent. this transparent color is required by default to avoid the jerking of the text when a border is added on hover.
I have modified your code a bit just for your understanding.
.topMenu {
text-transform: uppercase;
background-image: url('images/1.png');
position: absolute;
height: 88px;
width: 400px;
background: lightcoral;
/* margin-left: 332px; */
padding-top: 30px;
}
.topMenuOptions {
padding: 0;
margin: 0;
margin-left: 155px;
list-style-type: none;
}
.topMenuOptions li {
cursor: pointer;
padding: 10px;
color: white;
font-size: 14px;
display: inline;
border-bottom: 3px solid transparent;
}
.topMenuOptions li:hover:nth-child(1) {
background: url('http://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg') center center no-repeat;
background-position: 0px 0;
background-size: contain;
color: transparent;
border-bottom: 3px solid #fff;
}
.topMenuOptions li:hover:nth-child(2) {
background: url('http://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg') center center no-repeat;
background-size: contain;
background-position: 0px 0;
color: transparent;
border-bottom: 3px solid #fff;
}
.topMenuOptions li:hover:nth-child(3) {
background: url('http://php.quicoto.com/wp-content/uploads/2013/06/css3.jpg') center center no-repeat;
background-size: contain;
background-position: 0px 0;
color: transparent;
border-bottom: 3px solid #fff;
}
<div class="menu topMenu">
<ul class="topMenuOptions">
<li><span>111</span></li>
<li><span>222</span></li>
<li><span>333</span></li>
</ul>
JSFIDDLE
`<ul>
<li class="option">
<span id="text">111</span>
<span id="image" class="hide">IMAGE</span>
</li>
<li class="option">
<span id="text">222</span>
<span id="image" class="hide">IMAGE</span>
</li>
</ul>`
.option:hover .option > #image
{
display:block;
border-bottom:1px solid black;
}
.option:hover: .option > #text
{
display:none;
}
.hide
{
display:none;
}
you can do something like this, which is more efficient,
inside the image span you can add a image tag, which will also do the job.

Submenu doesn't get displayed

I'm trying to make sub-menus for my menu, but something just isn't right and doesn't pop out like I want.
<div class="navbox">
<ul class="nav">
<li>Program</li>
<li><ul>
<li>Teknik</li>
<li>Naturvetenskap</li>
<li>El</li>
</ul></li>
</ul></div>
* { margin:0;
padding:0;
}
html {height: 100%;}
body{
position: relative;
height: 100%;
background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff));
}
.navbox {
position: relative;
float: left;
}
ul.nav {
list-style: none;
display: block;
width: 200px;
position: relative;
top: 100px;
left: 100px;
padding: 60px 0 60px 0;
background: url(shad2.png) no-repeat;
-webkit-background-size: 50% 100%;
display: inline-table;
}
li {
margin: 5px 0 0 0;
}
ul.nav li a {
-webkit-transition: all 0.3s ease-out;
background: #cbcbcb url(border.png) no-repeat;
color: #174867;
padding: 7px 15px 7px 15px;
-webkit-border-top-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
width: 100px;
display: block;
text-decoration: none;
-webkit-box-shadow: 2px 2px 4px #888;
}
ul.nav li :hover {
background: #ebebeb url(border.png) no-repeat;
color: #67a5cd;
padding: 7px 15px 7px 30px;
}
The problem with the code is that I want to get the link "Program" to display the submenus under, "Teknik" "Naturvetenskap" "El" but I just can't get them to pop out under. I can't get them to pop out at all, and that's all I need, I'll have to deal with design later.
Made it into a codepen for you - http://codepen.io/anon/pen/pxfKE - and tried to answer what I think you were looking for. It should be pretty self explanatory, but let me know if you need help understanding it :)

Align text vertically center of h2 tag with a background

I have a h2 tag that has a background image as an icon. I want to align the text vertically within the h2 tag but it doesn't work. I have tried using the display: table-cell; but that hasn't worked either. The text may also crossover onto two lines.
HTML:
<ul class="FeatureRow">
<li><span><h2 class="SpeechBg">Need some help?</h2><p>Feel free to get in contact with us</p></span></li>
<li><span><h2 class="PinBg">Great locations!</h2></span></li>
<li><span><h2 class="ViewBg">View our apartments</h2></span></li>
</ul>
CSS:
a {
color: #2b6893;
text-decoration: none;
}
.FeatureRow{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
.FeatureRow li{
float: left;
padding: 10px;
margin: 10px;
height: auto;
-webkit-box-shadow: 0px 4px 8px #f5f5f5;
-moz-box-shadow: 0px 4px 8px #f5f5f5;
box-shadow: 0px 4px 8px #f5f5f5;
background-color: #fdfdfd;
background-image: -moz-linear-gradient(top,#fbfbfb,#ffffff);
background-image: -webkit-gradient(linear,0 0,0 100%,from(#fbfbfb),to(#ffffff));
background-image: -webkit-linear-gradient(top,#fbfbfb,#ffffff);
background-image: -o-linear-gradient(top,#fbfbfb,#ffffff);
background-image: linear-gradient(to bottom,#fbfbfb,#ffffff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbfbfb',endColorstr='#ffffffff',GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled= false);
}
.FeatureRow span{
display: block;
width: 260px;
}
.FeatureRow h2{
background-repeat: no-repeat;
padding-left: 65px;
font-size: 22px;
height: auto;
min-height: 60px;
color: #3F92ED;
}
.SpeechBg{
background-image: url(http://joshblease.co.uk/Apartments/images/icons/speech.png);
}
.PinBg{
background-image: url(http://joshblease.co.uk/Apartments/images/icons/pin.png);
}
.ViewBg{
background-image: url(http://joshblease.co.uk/Apartments/images/icons/view.png);
}
JSFiddle Example: http://jsfiddle.net/YPnTp/
In .SpeechBg, .PinBg, and .ViewBg, add line-height: ##px;, where ## is the height (in px) of the background images.
Change your
.FeatureRow h2 , add line-height
css as follows
.FeatureRow h2{
background-repeat: no-repeat;
padding-left: 65px;
font-size: 22px;
height: auto;
min-height: 60px;
color: #3F92ED;
line-height:2.5em;
}

Chrome 1px line bug

I am making one fan-site and have very stupid bug on news bar. When I zoom the page, 1px line appears.
This is the code:
<div class="velikibar">
<div id="velikibar_h">
<div id="naslovbar"><?=$naslov?></div>
</div>
<div id="velikibar_b">
<div class="paddingvelikibar">
<?=$sadrzaj?>
</div>
</div>
<div id="velikibar_f">
<div id="fblikedugme"><?=$vreme?><br /><div class="fb-like" data-href="http://********.**/article.php?id=<?=$id?>" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div></div>
<div id="komentarbarbox">Komentari (<?=$brkomentara?>)</div>
</div>
And this is the CSS (http://tny.cz/d9fb11db):
.velikibar
{
background-color:transparent;
width: 652px;
}
#velikibar_h
{
background-image:url('slike/velikibar_h.png');
background-repeat: no-repeat;
width: 652px;
height: 109px;
padding: 0;
margin: 0;
}
#velikibar_b
{
background-image:url('slike/velikibar_b.png');
background-repeat: repeat-y;
width: 652px;
min-height: 30px;
padding: 0;
margin: 0;
}
#velikibar_f
{
background-image:url('slike/velikibar_f.png');
background-repeat: no-repeat;
width: 652px;
height: 112px;
padding: 0;
margin: 0;
}
#velikibar_f2
{
background-image:url('slike/velikibar_f2.png');
background-repeat: no-repeat;
width: 652px;
height: 112px;
padding: 0;
margin: 0;
}
.paddingvelikibar
{
padding: 5px 35px 5px 30px;
text-align:justify;
color: #fff5f9;
}
#fblikedugme
{
position: absolute;
margin-left: 35px;
margin-top: 40px;
color:#fff5f9;
line-height: 20px;
}
#komentarbarbox
{
position: absolute;
margin-left: 425px;
margin-top: 65px;
}
#komentarbarbox a, #komentarbarbox a:link, #komentarbarbox a:visited
{
font-size: 14px;
font-weight: bold;
text-shadow: 0 1px 0 #6f1c3f;
color: #fdd2e4;
text-decoration:none;
}
#komentarbarbox a:hover, #komentarbarbox a:focus
{
color: #d61566;
text-decoration:none;
}
#naslovbar
{
font: 23px/1.4em arial, helvetica;
color: #e1aec4;
padding-top: 50px;
padding-left: 35px;
text-shadow: #FCFCFC 0px 1px 0px;
}
.paddingvelikibar img
{
background-color: #fff2f7;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
behavior: url("skripte/ie-css3.htc");
padding: 4px;
}
Please help me how to fix this. Thanks in advance
This appears to be a browser bug.
For example, an element which is 5px wide, viewed on 1.5 zoom would be 7.5px wide, but the browser has to round it to full pxls so something like this can happen.
To make sure it doesnt happen you can make the elements overlap, or in your case, best would be not to split the pink background image in 2 elements, but have a single element carry the whole image.
Chrome doesnt use font-resize as zoom option, so it is very unlikely that this is caused by a particullar line of css.