Chrome 1px line bug - html

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.

Related

HTML / CSS: Div not expanding to height of content

I've got a few div elements that aren't expanding to match the height of their content. I have read that this can be caused by float-ed content; This content isn't float-ed - although I am beginning to feel like I should throw my computer in a river. Does that count?
code:
#interaction-options-container.display-dialogue {
left: 15%;
width: 70%;
}
#interaction-options-container.full-border, .dialogue-container.full-border {
border: 1px solid #33ffff;
}
#interaction-options-container {
margin: 4px 0px 4px 0px;
z-index: 100;
position: absolute;
left: 35%;
bottom: 4%;
width: 30%;
line-height: 1.4;
opacity: 0.75;
}
#interaction-options-container .heading {
font-size: 16px;
color: black;
padding: 0.1px 12px 0.1px 12px;
background-color: grey;
}
.heading {
font-weight: bold;
font-size: 1.5em;
padding: 8px 12px 0px 12px;
}
#interaction-options-container p {
margin: 8px 0px 8px 0px;
}
#interaction-options-container .dialogue p {
margin: 4px 0px 4px 0px;
}
#interaction-options-container .button, #interaction-options-container .evidence-options-container .button {
cursor: pointer;
color: white;
font-size: 14px;
padding: 0.1px 12px 0.1px 12px;
background-color: #333333;
opacity: 0.85;
border-bottom: 1px solid #8d8d8d;
}
#interaction-options-container .dialogue-container {
padding: 0px;
margin: 0px;
width: 100%;
height: 32px;
background-color: #333333;
float: none;
}
#interaction-options-container .dialogue {
text-align: center;
margin: auto;
font-size: 16px;
font-weight: bold;
padding: 1px 12px 1px 12px;
color: white;
background-color: #333333;
}
.dialogue-container .dialogue.option-divider {
border-bottom: 1px solid #333333;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
<div class="hud-element display-dialogue full-border" id="interaction-options-container">
<div class="heading"><p>Choose a reply:</p></div>
<div class="dialogue-container button">
<div class="dialogue option-divider"><p>Option one here</p></div>
</div>
<div class="dialogue-container button">
<div class="dialogue option-divider"><p>Option two here</p></div>
</div>
<div class="dialogue-container button">
<div class="dialogue option-divider"><p>Option three here</p></div>
</div>
<div class="dialogue-container button">
<div class="dialogue"><p>Option four here. As an example this text should be long enough to require wrapping to a new line. I will therefore have to keep typing until I've added enough text to sufficiently fill the horizontal with of the containing div. Also, thanks for potentially answering my question, which I will get to below...</p></div>
</div>
</div>
The problem is, when a piece of dialogue requires wrapping to a new line, the .dialogue-container .button div does not expand in height to match the height of the .dialogue div. The inner divs therefore extend past the border lines, which looks bad.
If anyone has any pointers, my computer will thank you.
Cheers.
#interaction-options-container .dialogue-container {
padding: 0px;
margin: 0px;
width: 100%;
//height: 32px;
background-color: #333333;
float: none;
}

How to make a titled box with css?

I'm making a titled box with css.
And my code is something like this.
I've ignored some attributes like width or height in my code.(Because I don't know why stackoverflow keeps telling me that I 've got too many codes here..)
.sponsor_info {
border-radius: 10px;
border: 1px solid #eeeeee;
width:200px;
height:50px;
padding: 0px;
}
.sponsor_info .headbar {
border-radius:10px 10px 0px 0px;
width:200px;
height: 40px;
margin-top: 0px;
background-color: #8BBE26;
}
.sponsor_info .headbar p {
font-size: 20px;
font-family: arial;
color:white;
line-height: 100%;
margin-left: 3%;
margin-top:0px;
}
<div class="sponsor_info">
<div class="headbar">
<p>Sponsor Info</p>
</div>
</div>
I can get something like below
The question now is: I don't know why there is some space between the outer grey border and the inner green bar.
.sponsor_info {
height: 200px;
border-radius: 10px;
border: 1px solid #eeeeee;
padding: 0px;
}
.sponsor_info .headbar {
height: 100px;
border-radius: 10px 10px 0px 0px;
margin-top: 0px;
background: #8BBE26;
}
.sponsor_info .headbar p {
line-height: 100px;
margin-left: 3%;
margin-top: 0px;
}
<div class="sponsor_info">
<div class="headbar">
<p>Sponsor Info</p>
</div>
</div>
change it to:
.sponsor_info .headbar p {
line-height: 100%;
margin-left: 3%;
margin-top: 0px;
}

how to make a span not show the excess amount of text

I've got the following css element. the CSS is as following
.bill-item {
width: 253px;
height: 60px;
background-color: white;
border: 1px solid #dadada;
border-radius: 6px;
margin-left: 22px;
margin-top: 15px;
margin-bottom: 15px;
}
.item-drop-point {
height: 40px;
width: 253px;
border: 1px dashed #dadada;
text-align: center;
background-color: white;
border-radius: 6px;
margin-left: 22px;
margin-top: 15px;
margin-bottom: 15px;
}
.item-drop-point span {
color: #dadada;
vertical-align: -10px;
}
.bill-item-img {
height: 60.4px;
width: 60px;
float: left;
border-radius: 5px;
background-image: url(../images/bill_item_img.jpg);
background-repeat: no-repeat;
background-size: cover;
}
.bill-item-description {
width: 148px;
float: left;
height: 100%;
}
.bill-item-price {
float: left;
padding: 8px 0px 0px 7px;
width: 107px;
height: 25px;
font-family: MyriadProReg;
}
.bill-item-amount {
float: right;
padding: 8px 0px 0px 7px;
width: 25px;
height: 22px;
border-left: 1px solid rgb(230, 230, 230);
}
.bill-amount-selection {
width: 44.9px;
height: 100%;
float: right;
background-image: url(../images/item_amount_selection_bg.jpg);
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
.amount-increase {
height: 50%;
width: 100%;
background-image: url(../images/item_amount_inc.jpg);
background-position: center center;
background-repeat: no-repeat;
display: block;
}
.amount-decrease {
height: 50%;
width: 100%;
background-image: url(../images/item_amount_dec.jpg);
background-position: center center;
background-repeat: no-repeat;
display: block;
}
.bill-item-name {
padding-top: 5px;
border-bottom: 1px solid rgb(230, 230, 230);
height: 25px;
font-family: MyriadProReg;
}
.bill-item-name-left {
float: left;
padding-left: 6px;
padding-right: 5px;
padding-top: 4px;
font-family: MyriadProReg;
font-weight: normal;
font-size: 14px;
}
.bill-item-name-right {
float: right;
padding-top: 3px;
color: #878787;
font-family: MyriadProReg;
font-weight: 400;
}
I load text using an ajax post so some times I get more characters that I can show in the element. I hope you can get an idea from the following image.
The div hierarchy is following.
<div class="bill-item">
<!-- Item image -->
<div class="bill-item-img"></div>
<!-- Item description -->
<div class="bill-item-description">
<div class="bill-item-name">
<!-- Item Name -->
<p class="bill-item-name-left">Normal Cofee</p>
<!-- Item Price -->
<p class="bill-item-name-right">170.00</p>
<div class="clear"></div>
</div>
<!-- Total item price -->
<div class="bill-item-price">
<span>170.00</span>
</div>
<!-- Item Quantity -->
<div class="bill-item-amount">
<span>1</span>
</div>
</div>
<!-- Increas & Decrease item Quantity -->
<div class="bill-amount-selection">
<a class="amount-increase" href="#"></a>
<a class="amount-decrease" href="#"></a>
</div>
</div>
How can I fix this issue using CSS.. please help me!
Posting this as an answer to show the changes on the CSS class bill-item-name-left, did you tried something like this ?
.bill-item-name-left {
float: left;
padding-left: 6px;
padding-right: 5px;
padding-top: 4px;
font-family: MyriadProReg;
font-weight: normal;
font-size: 14px;
white-space: nowrap;
overflow:hidden;
}
If that does the trick, you should check the value you can set on the overflow or even use the text overflow property, more info : http://www.w3schools.com/cssref/css3_pr_text-overflow.asp

spans in an anchor in a single line

I am trying to have all three spans within an anchor, inline. Not sure what is missing from the code:
a.facebook-button {
float: none;
display: inline-block;
margin-bottom: 5px;
left: auto;
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.6);
}
.fb-button-left {
width: 40px;
}
.fb-button-right,
.fb-button-center,
.fb-button-left {
float: left;
height: 40px;
background: url(../img/fb-button.png) left top no-repeat;
}
.fb-button-right {
width: 6px;
background-position: 100% -80px;
}
.fb-button-center {
padding: 0 5px 0 8px;
line-height: 40px;
font-size: 16px;
color: #FFFFFF;
background-color: #6385ba;
background-position: left -40px;
background-repeat: repeat-x;
}
div.socialInvites {
padding: 20px 20px 0px 20px;
text-align: center;
left: auto;
}
<div class="socialInvites">
<a href="main/facebook_request" class="facebook-button" id="facebookbutton">
<span class="fb-button-left"></span>
<span class="fb-button-center"><strong>Connect</strong> with <strong>Facebook</strong></span>
<span class="fb-button-right"></span>
</a>
</div>
Please try adding the following:
display:inline;
Example:
.fb-button-right {
width: 6px;
background-position: 100% -80px;
display:inline;
}
Also, same for the fb-button-center.

horizontal css navigation problem

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.