css dialox box to html li item - css

how can I have kinda like dialog boxes besite the bullet of a li element?
<div class="contentContenedor">
<div class="tituloContentContenedor">Box: Promociones nacionales</div>
<div class="linksContentContenedor">
<ul>
<li>
<span>Vuela barato por Chile</span>
<span class="linksContentContenedorClicks" style="background-color:blue; color:white; float:right; padding:0px 4px 0px 4px">612</span>
</li>
<li>
<span>Encántate con el sur de nuestro país</span>
<span class="linksContentContenedorClicks" style="background-color:blue; color:white; float:right; padding:0px 4px 0px 4px">102</span>
</li>
<li>
<span>Disfruta el norte de Chile</span>
<span class="linksContentContenedorClicks" style="background-color:blue; color:white; float:right; padding:0px 4px 0px 4px">64</span>
</li>
<li>
<span>Canjea tus kms. y vuela por Chile</span>
<span class="linksContentContenedorClicks" style="background-color:blue; color:white; float:right; padding:0px 4px 0px 4px">49</span>
</li>
</ul>
</div>
</div>
(I can change de order of the span, or put the info outside the li)
CSS:
.contentContenedor{
background-image:url('img/fondo_cajas_home.gif');
background-repeat:no-repeat;
background-position:center bottom;
width:270px;
height:140px;
}
.tituloContentContenedor{
background-image:url('img/fondo_tit_cajas_home_270_23.gif');
background-repeat:no-repeat;
width:270px;
height:23px;
color:white;
font:bold 11px Arial,Helvetica,sans-serif;
padding:6px 0px 2px 11px;
}
.linksContentContenedor{
font-size:12px;
text-decoration:underline;
color:#0267C3;
}
.linksContentContenedor ul{
padding:0;
margin:0;
margin-left:28px;
padding-bottom:10px;
}
.linksContentContenedor li span{
position:relative;
left:-5px;
}
.linksContentContenedorClicks{
position:absolute;
left:10px;
}
I'm able tu add a square with info beside de li element but it stays inside de container.
I'd like it to be like:
but for each li element and always pointing to the bullet.
what complicates me the most is that im not able to get the info outside the container.
if I add absolute position then I wouldnt know the left and top margins since, this boxes are php created.
PS: it is not a tooltip, kinda looks like it but it has to be always present, not when hovering or whatever.
thsnk youuu!

Here is what I did,
.info {
position: absolute;
right: 115%;
width: 60px;
height: 40px;
background: #c1c1c1;
text-align: center;
}
.info:before {
content: "";
height: 0;
width: 0;
position: absolute;
left: 100%;
border-left: 15px solid #c1c1c1;
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
}
This css will make the "info box" you are looking for. This is just a start so you can tweek it in anyway you want. If you are looking for just a border and not solid color then I would advice you to use an image. It could be possible I believe but not very effect/supported.
Here is the JSFIDDLE with the rest of css. Just make sure the li containing the .info is position: realtive;.

Related

add little dropdown menu to existing button in pure CSS

I have that simple button in my application. I want to add little dropdown when hover on it and also to see icons then name on the option list coming up and all thin in pure css so I can link to php pages when clicking on the menu.
http://jsfiddle.net/seby20/JB59c/
CSS
.ann_search_submit {
background:transparent url("images/fancybutton.png") no-repeat top left;
max-width : 131px;
}
.newhead{
padding-left:4px;
padding-right:4px;
margin-right:2px;
padding-top:4px;
padding-bottom:1px;
cursor:pointer;
line-height:16px;
margin-top:2px;
text-decoration: none;
font-size: 12px;
}
.ann_submit {
color : #09509B;
padding: 4px;
margin:0px 0px 5px 3px;
border : none;
background:transparent url("images/fancybutton.png") no-repeat top right;
}
.ann_submit:hover {
color:#0271E6;
}
HTML
<div class="newhead" >
<div class="ann_search_submit">
<div class="ann_submit"><img src="images/plus-icon 2.png" title="Add Call" align="absmiddle" >
<?=HEAD_BUTTON_ADD_CALL?>
</div>
</div>
</div>
Use this code
HTML
<div class="ann_search_submit">
<div class="ann_submit">
<img src="http://www.mkstats.ca/plus-icon 2.png" title="Add Call" align="absmiddle" >
Add New Phone Call</div>
<div class="dropdown">
Option1 <br/>
Option2 <br/>
Option3 <br>
</div>
</div>
CSS
.ann_search_submit {
background:transparent url("images/fancybutton.png") no-repeat top left;
max-width : 131px;
}
.newhead {
padding-left:4px;
padding-right:4px;
margin-right:2px;
padding-top:4px;
padding-bottom:1px;
cursor:pointer;
line-height:16px;
margin-top:2px;
text-decoration: none;
font-size: 12px;
}
.ann_submit {
color : #09509B;
padding: 4px;
margin:0px 0px 5px 3px;
border : none;
background:transparent url("http://www.mkstats.ca/fancybutton.png") no-repeat top right;
}
.ann_submit:hover {
color:#0271E6;
}
.dropdown {
display: none;
height:100px;
width:200px;
}
.ann_search_submit:hover>.dropdown {
display: block;
}

why div in center

I know its the noobest question you had every seen but but really guys I am not able to find whats wrong in my css. I am trying to float two divs inside a footer div. But the problem is that the first div (#copyrights) is just stuck in the middle. It looks like there's something wrong with the main container (#footer). Because when I place the last container outside it then everything works great
Have a look at my code on jsfiddle.
Heres my HTML (The footer div is at the bottom):
<div id="footer">
<!-- Upper footer -->
<div id="upper-footer">
<!--Footer Navigation Links -->
<ul>
<li>
Home
</li>
<li>
About Us
</li>
<li>
The Mall
</li>
<li>
Media Center
</li>
<li>
Contact Us
</li>
</ul>
<!-- End od Footer nav links -->
<!--Start of newsletter div -->
<div id="newsletter">
<span>SignUp To Get The Latest News & Updates</span>
<form>
<input class="rounded" type="text" value="Your Email Here..." >
<input class="rounded-button" value="SUBSCRIBE" type="button" >
</form>
</div>
<!--End of Newsletter div-->
</div>
<!-- End of upper footer -->
<!-- Start of lower footer -->
<div id="lower-footer">
<div id="copyrights">
2013 Boulevar Mall. All rights reserved.
</div>
<div id="social">Follow us </div>
</div>
<!--End of lower footer -->
And here's my css:
#import url(http://fonts.googleapis.com/css?family=Droid+Sans);
#footer
{
height:100px;
font-family: 'Droid Sans', sans-serif;
text-transform:capitalize;
font-size:14px;
}
/*css for upper footer */
#upper-footer
{
height:70%;
background-color:#efe7e1;
}
#upper-footer #newsletter
{
float:right;
height: 100%;
display: table;
}
#upper-footer ul
{
list-style:none;
margin-top: 0px;
float:left;
width:480px;
}
#upper-footer ul li
{
display:inline-block;
height: 100%;
border-left: 1px solid d7cfca;
}
#upper-footer ul li:nth-child(1)
{
border-left:none;
}
#upper-footer ul li a
{
line-height:200%;
text-decoration:none;
color:#9b907c;
display:block;
line-height:70px;
padding-left:15px;
padding-right:15px;
width: 100%;
}
#upper-footer #newsletter span
{
color:#726753;
width:150px;
display: table-cell;
vertical-align: middle;
}
#upper-footer #newsletter form
{
display: table-cell;
vertical-align: middle;
padding-left: 15px;
}
/*for rounded text box */
input.rounded
{
border: 1px solid #ccc;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 2px 2px 3px #666;
-webkit-box-shadow: 2px 2px 3px #666;
box-shadow: 2px 2px 3px #666;
font-size: 9.42px;
padding: 4px 7px;
outline: 0;
-webkit-appearance: none;
height:26px;
width:163px;
text-align:center;
}
/*for rounded button */
input.rounded-button
{
border: 1px solid #ccc;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
font-size: 9.42px;
padding: 4px 7px;
outline: 0;
-webkit-appearance: none;
height:29px;
width:80px;
background-color:#726753;
color: white;
font-weight: bold;
}
input.rounded-button:hover
{
background-color:white;
border:#726753 solid 1px;
color:#726753
}
/*css for lower footer */
#lower-footer
{
background-color:#726753;
height:30%;
color:white;
}
#lower-footer #copyrights
{
float:left;
}
#lower-footer #social
{
float:right;
}
Your're free to point out my mistakes as I am very new to this stuff :)
Thanks in advance!
It is the margin on #upper-footer ul that's not letting your #copyrights float to the extreme left. Try replacing #upper-footer ul rule with following
#upper-footer ul
{
list-style:none;
margin: 0;
float:left;
width:480px;
}
it sets all margins for #upper-footer ul to zero instead of only margin-top.
Update
As the margin of the #upper-footer ul element is overflowing out of its parent, #upper-footer, setting overflow: hidden for #upper-footer will also do the trick.

css: z-index and float-right

I'm trying to lay my menu div onto facebook share div. The main problem is,that z-index doesn't work,even when i use position:relative on both div. Do You know,how i may to fix it?
P.S I added photo where You can see,what exactly goes wrong
http://img4.imageshack.us/img4/1563/problemscreenshot.png
<div id="facebook_connect">
<a href="something,something,something-thedarkside">
<img src="/img/facebook_connect.png"/>
</a>
</div>
<div id="header_menu">
<ul>
<li class="menu_link_left highlight">Strona główna</li>
<li class="menu_link_inside">O nas</li>
<li class="menu_link_inside">Usługi</li>
<li class="menu_link_right">Kontakt</li>
</ul>
</div>
and CSS code:
#facebook_connect{
height:50px;
width:20px;
top:30px;
position:relative;
z-index:1;
float:right;
}
#facebook_connect a, img{
position:relative;
z-index:1;
}
/*=======================================*/
#header_menu{
position:relative;
z-index:2;
height:30px;
width:350px;
background:#ececec;
border-radius:5px;
float:right;
top:60px;
-moz-box-shadow: 0px 0px 6px #000;
-webkit-box-shadow: 0px 0px 6px #000;
box-shadow: 0px 0px 6px #000;
}
So, if I'm not mistaken, what you're trying to accomplish is having your Facebook share button underneath your navigation, and I'm assuming you want it to protrude a bit from the top, giving it a somewhat layered effect.
If this is the case, the issue is not with the z-index, it is a positioning issue. You can correct this by placing the two divs within a container. Try this:
HTML:
<div id="cont">
<div id="header_menu">
<ul>
<li class="menu_link_left highlight">Strona główna</li>
<li class="menu_link_inside">O nas</li>
<li class="menu_link_inside">Usługi</li>
<li class="menu_link_right">Kontakt</li>
</ul>
</div>
<div id="facebook_connect">
<a href="something,something,something-thedarkside">
<img src="/img/facebook_connect.png"/>
</a>
</div>
</div>
CSS:
#cont {
position: relative;
top:60px;
float:right;
}
#facebook_connect{
position:absolute;
top: 5px;
right: 20px;
height:50px;
width:20px;
z-index:1;
}
#header_menu{
position: relative;
height:30px;
width:350px;
background:#ececec;
border-radius:5px;
-moz-box-shadow: 0px 0px 6px #000;
-webkit-box-shadow: 0px 0px 6px #000;
box-shadow: 0px 0px 6px #000;
z-index:2;
}
Then position as you see fit.

Getting rid of an unwanted space between 2 divs

I have searched google, but I didn't find anything. I searched this site and found this topic Unwanted space between divs which seems similar, and i have tried to apply
margin:0px;
several places, but there i still, space between the two divs.
Heres my html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>title/title>
<link rel="stylesheet" type="text/css" href="e.css">
</head>
<body>
<div id="page">
<div id="content">
<div id="up">
<div id="tab">
<ul id="tabmenu">
<li id="anm" class="tbs blue"><span>Anm</span></li>
<li id="kom" class="tbs blue"><span>Kom</span></li>
<li id="omt" class="tbs blue"><span>Omt</span></li>
<li id="sts" class="tbs blue"><span>Sts</span></li>
</ul>
</div>
<div id="usrp">
<div id="usr">
</div>
</div>
</div>
</div>
<div id="bottom">
</div>
</div>
</body>
</html>
And my Css
html {
height: 98%;
}
body {
height:99%;
}
#page {
height:99%;
}
#content {
/*border:2px solid blue;*/
}
#bottom {
border:2px solid green;
height:15%;
vertical-align: bottom;
}
#up {
/*border:dotted green 2px;*/
width:59%;
}
.usrcom {
border-bottom: 2px dotted blue;
margin-left:15px;
margin-right:15px;
}
#usrp {
width:100%;
clear:both;
border-right: 2px solid blue;
border-left: 2px solid blue;
border-bottom:2px solid blue;
border:dotted yellow 2px;
}
/***Tabs menu*****/
#tabmenu {
float:left;
width:685px;
/*background:#BBD9EE;*/
/*background:#FF6633;*/
font-size:93%;
line-height:normal;
margin-top: 0px;
margin-left: 0px;
/*border:dotted red 2px;*/
border-bottom:2px solid blue;
/*border:dotted red 2px;*/
}
#tabmenu ul {
/*background:#BBD9EE;*/
padding:0px 0px 0 0px;
margin:0px;
list-style:none;
border:dotted green 2px;
}
#tabmenu li {
display:inline;
padding:0;
margin:0px;
}
#tabmenu a {
float:left;
/*background:url("img/tableft2.png") no-repeat left top;*/
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
#tabmenu a:hover span {
background-color:#3399FF;
margin:0px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}
#tabmenu a span {
float:left;
display:block;
/*background:url("img/tabright2.png") no-repeat right top;*/
padding:5px 15px 4px 5.5px;
margin:0px;
color:#FFFFFF;
background-color:#0000FF;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}
I can find out why the space happens, how can I solve this unwanted space.
Edit:
Ups, yearh, forgot to tell which divs,
It is between 'Tabmenu' and 'usrp'
Edit:
Tried to apply in my css
#tab {
margin: 0px;
padding:0px;
}
For it is in really between 'tab' and 'usrp' but that does no help.
In CSS:
#tabmenu {
margin:0;
}
should do the trick
Learn how to use an inspector and "inspect this element". Then you can hover over all the elements on your page and literally see their margins/paddings, and what CSS is causing them. You can even edit CSS on-the-fly to test out a fix before applying it. My preference is the Firebug add-on for Firefox, but Chrome, Safari, and even Internet Explorer all have them built in now.

css border problem

How do i put a border on a div in css that doesn't have a set height?
Want to achieve this without using any javascript. Code is below.
HTML
<div id="main_container">
<div id="header">
<div id="topMenu">
<ul id="topNav">
<li>Home</li><li>Contact</li><li>Links</li>
</ul>
</div>
<div id="mainMenu">
<ul id="mainNav">
<li >Home</li><li >About Us</li><li >Multimedia</li><li >Multimedia</li><li >Multimedia</li><li >Multimedia</li><li >Multimedia</li><li >Multimedia</li>
</ul>
</div>
</div>
</div>
css
body{
text-align:center;
min-width:70%;
}
#main_container{
position:relative;
width:980px;
margin:auto;
text-align:center;
background-color:#FFFFFF;
border-color: #999999;
border-style: solid ;
border-width: 1px ;
margin-bottom: 20px;
}
#header{
position: relative;
width: 980px;
}
#mainMenu{
float:left;
width: 980px;
top: 50px;
background-color: #0099FF;
height: 30px;
}
#mainNav{
text-align: left;
}
ul#mainNav li{
display: inline;
margin: 0px 20px 0px 0px;
}
#topMenu{
width: 150px;
top: 10px;
text-align: right;
float:right;
margin-bottom: 20px;
}
ul#topNav li{
display: inline;
margin: 0px 10px 0px 0px;
}
#footer{}
Thanks in advance.
Does it work?
<div style="border:1px solid #000">
Your content here
</div>
It doesn't matter if there is no height attribute. Just use the border property as you normally would.
Edit: since you mention you have other divs inside your container div, I suspect you might need to use a clear. If you're still having issues with either the background or border not extending the length of the container, try adding this right before the closing div of the container:
<div style="clear:both"></div>
Just give the div some padding or content inside.
div {
border: solid 1px #000;
padding: 10px;
}

Resources