I have a center div and a simple problem...
I don't know how to place a image right to it relative(!) like this:
<div class="text_middle">
<span class="volat_text">App</span>
<div id="sport_dropdown">
<span id="sport">Test</span>
</div>
</div>
<img id="arrow_down" src="img/arrow_down.png">
Here is the code: http://codepen.io/lalaluki/pen/pNNYpZ
Does somebody knows a trick?
You can place something like <span>▾</span> inside your .text_middle element. I used the html symbol code for a downside triangle because you did not provide the image in your pen example. But you can try it with an image or glyphicon instead.
<div class="text_middle">
<span class="volat_text">App</span>
<div id="sport_dropdown">
<span id="sport">Test</span>
</div>
<span>▾</span>
</div>
See the pen here
.vertical_align{
vertical-align:middle;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div id="top_bar">
<div class="text_middle">
<span class="volat_text">App</span>
<div id="sport_dropdown">
<span id="sport">Test</span>
<span class="glyphicon glyphicon-chevron-down vertical_align" ></span>
</div>
</div>
Try this.
Hope this helps.
I would apply float:right to the image:
#arrow_down {
float:right;
}
Need to change your HTML Structure to achieve this quickly. Add image inside '.text-middle' div
<div class="text_middle">
<span class="volat_text">App</span>
<div id="sport_dropdown">
<span id="sport">Test</span>
</div>
<img id="arrow_down" src="img/arrow_down.png">
</div>
Add vertical align middle to your image
#arrow_down {
vertical-align: middle;}
Hope this will help you
Related
I'm not sure if it's possible to modify a wild card element which also has a pseudo element style. I'm trying to remove an annoying bit of padding but I'm not having much luck. Any help would be appreciated.
Here is the rendered HTML.
<div class="row">
<div class="span6">
<div id="parent-1">
::before
<div id="child-1">
<a class="link">
<img src="/picture.jpg" alt="">
<div class="hint">
<span class="hint-message">Hint Text</span>
</div>
</a>
</div>
::after
</div>
</div>
<div class="row">
<div class="span6">
<div id="parent-2">
::before
<div id="child-2">
<a class="link">
<img src="/picture.jpg" alt="">
<div class="hint">
<span class="hint-message">Hint Text</span>
</div>
</a>
</div>
::after
</div>
</div>
I want to modify the ":after" css pseudo element which is proving to be a little challenging.. not even sure if it's technically possible since it's not a real element?
Here is what I have tried so far
div[id^="child-"]:after{ padding:0px !important;}
also tried this
#child-*:after{ padding:0px !important;}
and this
:after { padding:0px !important;}
div[id^="child-"]:after{ padding:0px !important;}
This works for me. I created a demo here.
I think the "annoying padding" is caused by other reasons. Could you provide the css?
I would like to create an image slider with image border, and changing images to look like the screenshot.
My html
<div id="slideshow"><span class="control"
id="leftControl" style="display: none;">Move left</span>
<span class="control" id="leftControl"></span>
<div id="slidesContainer" style="overflow: hidden;">
<div id="slideInner" style="width: 3060px;">
<div class="slide" style="float: left; width: 1020px;">
<img src="/images/daf.png">
</div>
<div class="slide" style="float: left; width: 1020px;">
<img src="/images/daf.png">
</div>
<div class="slide" style="float: left; width: 1020px;">
3
</div>
</div>
</div>
<span class="control" id="rightControl"></span>
<div class="shadow_and_circles">
<div class="sl1">
</div>
<div class="sl2">
</div>
<div class="sl1">
</div>
</div>
<span class="control" id="rightControl">Move right</span>
</div>
You can find the css at my fiddle. My current result looks like this
What did i wrong? I have set the z-index, but what else must i do?
Update
I created a new fiddle
Like I said in my comment, your styles are messed up with inline CSS styles and linked classes. Also, there's no need to have all containers in absolute position.
Here's your demo. Is this what you're after?
__________EDIT_______________
It seems that you're having z-index issues so I've made a demo without using any stack positioning. Just use the classes that I include in the following demo.
Demo without z-index.
I am writing a page in HTML and CSS. Inside the page, I have several div tags that I want to center on the page. I have wrapped them all in a div tag with the class infogroup. Then, to my CSS, I added this code: .infogroup{text-align: center;}. It does not center the text in my browser (google chrome), but it does in jsfiddle. I am wondering why I am having this error, and what to do about it. The page has been tested locally and on a server, and has the trouble with both. The page live:
Thank you!
-Ty
HTML
<!DOCTYPE html>
<html>
<head>
<title>bridgeOrTunnel</title>
<link rel="stylesheet" type="text/css" href="bot.css">
</head>
<body>
<header><img src="botlogo.png"></header>
<div class="infogroup">
<div id="line1">
<span class="image"><img src="bri.png"></span>
<span class="image"><img src="tun.png"></span>
</div>
<div id="line2">
<span class="time">9 minutes</span>
<span class="time">13 minutes</span>
</div>
<div id="line3">
<span class="lanes">3 lanes open</span>
<span class="lanes">5 lanes open</span>
</div>
<div id="line4">
<span class="cost">$1.39</span>
<span class="cost">$4.27</span>
</div>
</div>
</body>
you forgot to include this in your bot.css
.infogroup{
text-align: center;
}
All I want is my two divs to stack next to one another. They are located inside a container. Why isn't it working?
This is my CSS:
#housecontainer {
height: 420px;
width: 1000px;
padding-left: 110px;
padding-top: 80px;
}
#houseimage {
float: left;
height: 388px;
width: 516px;
}
#rose {
width:200px;
height:100px;
float:left;
}
Judging by the HTML you posted in your comment, your page structure is:
#devcontainer
#develbox
#housecontainer
#houseimage
p
a
img
#rose
Since #rose is a child of #houseimage, it doesn't follow the same floating as it. Since #houseimage has a width of 516 and so does the image, there's no room left for #rose and it is forced below.
Just put one more </div> before <div id="rose">, so that it's inside #housecontainer and next to #houseimage, like you want. Then add the two other </div> you're missing.
You have several structure errors.
Try structuring your HTML like this:
http://jsfiddle.net/bGyV4/
This is the HTML you posted in your comment:
<div id="housecontainer">
<div id="houseimage">
<p>
<a href="images/rosebrook.pdf" target="_blank">
<img src="images/rosebrookthumb.png" width="516" height="388" />
</a>
<div id="rose">
<div id="rose">THIS ISNT WORKING!!!</div>
</div>
</p>
</div>
</div>
There are a number of issues with this:
The id of an element must be unique. It is used to identify the element. In your markup there are two div elements with id="rose".
From your question, it seems as if you want #houseimage and #rose to be side-by-side. This is not happening because #rose is inside #houseimage. That is, it is a child of #houseimage. You need to move it outside the div so that #rose is a sibling of #houseimage.
Change your HTML to be like this:
<div id="housecontainer">
<div id="houseimage">
<p>
<a href="images/rosebrook.pdf" target="_blank">
<img src="images/rosebrookthumb.png" width="516" height="388" />
</a>
</p>
</div>
<div id="rose">
<div id="roseChild">THIS ISNT WORKING!!!</div>
</div>
</div>
jsFiddle Demo
your html error,some DIV tag not closed,try this:
<div id="devcontainer">
<div id="develbox">
<div id="housecontainer">
<div id="houseimage">
<p>
<a href="images/rosebrook.pdf" target="_blank">
<img src="images/rosebrookthumb.png" width="516" height="388" />
</a>
</p>
</div>
<div id="rose">THIS ISNT WORKING!!!</div></div>
</div>
</div>
</div>
I've got the following...
<div id="nav-above" class="navigation">
<div class="nav-previous"><span class="meta-nav">«</span> title</div>
<div class="nav-next">title <span class="meta-nav">»</span></div>
</div><!– #nav-above –>
using external CSS alone is it possible to force all of that to remain on just one line?
Try this: http://jsfiddle.net/dT49F/
HTML:
<div class="container">
<div id="nav-above" class="navigation">
<div class="nav-previous">
<a href="link" rel="prev">
<span class="meta-nav">«</span>
much much longer link title here and here and here
</a>
</div>
<div class="nav-next">
<a href="link" rel="next">
much much longer link title here and here and here
<span class="meta-nav">»</span>
</a>
</div>
</div>
</div>
CSS:
.container div {
display: inline;
white-space: nowrap;
}
Any reason for the inner DIVs? I'd just drop them - and if you need the classes, assign them directly to the links:
<div id="nav-above" class="navigation">
<span class="meta-nav">«</span> title
title <span class="meta-nav">»</span>
</div><!– #nav-above –>
div[class^=nav-] {
float: left;
}
That should work. Please note my snippet is using CSS3 selectors, so it might not work in less-advanced browsers. Provide the same class to both divs, and then you can use normal selectors.
UPDATE:
This won't work in IE6, unless you do something like this:
<div id="nav-above" class="navigation">
<div class="nav-previous navigation-links"><span class="meta-nav">«</span> title</div>
<div class="nav-next navigation-links">title <span class="meta-nav">»</span></div>
</div><!– #nav-above –>
(Notice the new class .navigation-links)
And then just change the css selector:
div.navigation-links {
float: left;
}