Have difficulties to align elements with boostrap - html

I have some difficulties working with some CSS/HTML properties. I'm using bootstrap to have good rendering.
So I would like to have this :
The img is perfect but the problem is in the date (02.03.2013). I have put a float left on the img so the h3 works perfectly but not the date.
Could you help me please ? Here is what i have : http://jsbin.com/uqadoc/1/edit

Place a div around the <h3> and the <p> ( your date )
Have the H3 with a fixed width, and a Float:left;
and the p, float:right;
note : ive gone for a non div apreach in the jf but same concept
<div class='main'>
<img src='' class='ims'>
<div class='content'>
<h3 class="qwe" >serwqerqwrewqr</h3>
<p class="wer">dafdf</p>
<div class="rty" >
sfdg
ffffffffffffffffffffff
fdsffffffffffff</br>
sfdg
ffffffffffffffffffffff
fdsffffffffffff</br> sfdg
ffffffffffffffffffffff
fdsffffffffffff</br> sfdg
ffffffffffffffffffffff
fdsffffffffffff</br>
</div>
</div>
</div>
.main{
width:500px;
height:200px;
background:black;
}
.content{
width:100ps;
height:200px;
background:red;
}
.ims{
float:left;
width:100px;
height:200px;
background:blue;
}
.qwe{
float:left;
width:300px
height:50px;
}
.wer{
width:200px
height:50px;
float:right;
}
.rty{
padding-top:80px;
width:400px
float:right;
}
Jfiddle
http://jsfiddle.net/qAEzr/

Related

rotate text right side down using css

I have been constructing UI development for a year now and I want to explore new structures in regards to designing.
so I am styling my panel-heading that it would look something like this.
as of now I have only done the default style for panel heading via bootstrap css.
I just posted an example to how can make it with position. if you don't need then check 2nd snippet
.main {
position:relative;
}
.tilt {
position:absolute;
top:30px;
left:0px;
transform:rotate(-90deg);
color:#000;
padding:0 10px;
border:1px solid #000;
text-align:center;
}
.tilt p {
margin:0px;
}
<div class="main">
<div class="tilt">
<p>
HELLO
</p>
</div>
</div>
.tilt {
transform:rotate(-90deg);
color#000;
padding:0 10px;
border:1px solid #000;
text-align:center;
display:inline-block;
margin-top:22px;
}
.tilt p {
margin:0px;
}
<div class="tilt">
<p>
HELLO
</p>
</div>

Change WIDTH of DIVS next to each other on HOVER

I make 2 divs with different images next to each other.
One will be called "Land" and the other "Property".
On hover, I want to expend the width (From 50% to 75%) of the hovered div.
I managed to make it work with the left div but not with the right div.
How ? Why? Been tying a lot of things without success.
<body>
<div class="container-fluid">
<div class="size" id="proprety">
<h1>Propreties</h1>
<p>The best of the proprety</p>
</div>
<div class="size" id="land">
<h1>Land</h1>
<p>The best of the proprety</p>
</div>
</div>
</body>
.size{
height:600px;
overflow:hidden;
-webkit-transition: width .2s;
float:left;
background-repeat:no-repeat;
}
.borders{
padding:10%;
}
#proprety{
background-image:url(proprety.jpg);
width:50%;
}
#land{
background-image:url(land.jpg);
-webkit-transition: width .2s;
width:50%;
}
#proprety:hover{
width:75%;
}
#proprety:hover + #land{
width:25%;
}
#land:hover{
width:75%;
}
#land:hover + #proprety{
width:25%;
}
So far:
https://jsfiddle.net/Chloe75/akbqxc2v/
Short answer: the element+element selector only works for forward elements, and not backwards like you used in
#land:hover + #proprety{
width:25%;
}
Since #land comes after #proprety, it won't work like you want it to.
You can emulate this using flexbox like:
.size{
height:200px;
overflow:hidden;
-webkit-transition: width .2s;
float:left;
background-repeat:no-repeat;
}
.borders{
padding:10%;
}
#proprety{
background-color:blue;
width:50%;
}
#land{
background-color:green;
width:50%;
}
#proprety:hover, #land:hover{
width:75%;
}
div.container-fluid {
display: flex;
}
<body>
<div class="container-fluid">
<div class="size" id="proprety">
<h1>Propreties</h1>
<p>The best of the proprety</p>
</div>
<div class="size" id="land">
<h1>Land</h1>
<p>The best of the proprety</p>
</div>
</div>
</body>

How to move the bottom div to infront of the top one

I need help with moving the profile-options div.
Here's an image so I can show you what I mean, the code is provided below the image.
Picture
index.html
<div id="page">
<div id="content">
<div id="info">
<div id="profile" name="picture">
<img src="https://scontent-frt3-1.xx.fbcdn.net/v/t1.0-9/17021559_243918039403378_4935600322061460678_n.jpg?oh=aa472121820d78b6116c91d47557bce6&oe=59738E5C" name="profile" />
<img src="https://scontent-frt3-1.xx.fbcdn.net/v/t1.0-9/17098689_244217759373406_3036940291705168436_n.jpg?oh=5f7b2ead37fdec3c2b13fa60fe431a0c&oe=5924FEA8" name="frontpage" />
</div>
<div id="menu" name="profile-name">
Random Guy
</div>
<div id="menu" name="profile-options">
Hi
</div>
<div id="personal">
<ul>
<!-- fields about the user profile -->
<li>Password: *****************************</li>
<li>Country: Bosnia & Herzegovina</li>
<li>City: not choosen</li>
<li>Address: not choosen</li>
<li>Phone number: not choosen</li>
</ul>
</div>
</div>
</div>
</div>
style.css
#page #content #info #profile[name="picture"]
{
width:700px;
}
#page #content #info #profile[name="picture"] img[name="profile"]
{
width:128px;
height:128px;
}
#page #content #info #profile[name="picture"] img[name="frontpage"]
{
width:572px;
height:128px;
margin-left:-4px;
}
#page #content #info #personal
{
width:698px;
}
#page #content #info #menu[name="profile-name"]
{
background-color:#d8d8d8;
width:116px;
height:48px;
max-width:116px;
max-height:48px;
border:0px;
padding:6px;
word-wrap:break-word;
margin-top:-5px;
}
#page #content #info #menu[name="profile-options"]
{
background-color:#d8d8d8;
width:572px;
height:48px;
border:0px;
margin-top:-5px;
}
How can I achieve this without using any position commands or margin, I tried left:0px and top:0px but did not work.
‎
‎
‎
‎
‎
‎
‎
‎
Try adding the float left property:
#page #content #info #menu[name="profile-name"]
{
background-color:#d8d8d8;
width:116px;
height:48px;
max-width:116px;
max-height:48px;
border:0px;
padding:6px;
word-wrap:break-word;
margin-top:-5px;
float: left;
}
#menu {
display: inline-block;
}
https://jsfiddle.net/zkmuxayq/
Just add 'float:left/right' to both of them and make sure their width sum is not larger than 100%.
.div {
position:relative;
float:left;
height:50px;
}
.left {
width:20%;
background-color:grey;
}
.right {
width:80%;
background-color:black;
}
<div class="div left"></div>
<div class="div right"></div>
You have some issues.
First of all, ids must be unique and you have 2 "menu" ids.
To achieve what you want, you have to set "display: inline-block" to the 2 divs.
You need to add a float left to profile-name. Currently if you inspect that element you can see it is taking up the full width of the screen.
#page #content #info #menu[name="profile-name"]
{
background-color:#d8d8d8;
width:116px;
height:48px;
max-width:116px;
max-height:48px;
border:0px;
padding:6px;
word-wrap:break-word;
margin-top:-5px;
float: left
}

Vertically centered text keeps going under icon

I am trying to make a alert for my project which looks good but when I make it a mobile page the text goes under the icon. I want it to stay aligned beside the icon.
HTML:
<div class="rds-alert">
<img class="rds-alert-icon"/>
<div class="rds-alert-message">
<span class="rds-alert-so">Congratulation</span> Your submission has been approved.
</div>
</div>
CSS:
.rds-alert-so{
font-size:30px;
}
.rds-alert-icon{
width:70px;
height:70px;
vertical-align:middle;
margin-right:12px;
}
.rds-alert-message{
display:inline;
}
Jsfiddle: http://jsfiddle.net/0f2rpvc8/
Here's one way:
.rds-alert-so {
font-size:30px;
}
.rds-alert-icon {
width:70px;
height:70px;
margin-right:12px;
display:table-cell;
}
.rds-alert-message {
display:table-cell;
vertical-align:middle;
}
.rds-alert {
display:table-row;
}
<div class="rds-alert">
<img class="rds-alert-icon" />
<div class="rds-alert-message"> <span class="rds-alert-so">Congratulation</span> Your submission has been approved.</div>
</div>
or
.rds-alert-icon {
float: left;
}
http://jsfiddle.net/2Lfkrxup/

CSS: Doubts with padding behaviour

I am working with 2 DIVs, in a way that one lies above the other. And more things than expected happens when I increase the padding-top value of the first DIV.
The HTML code:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="EX7.css">
</head>
<body>
<div id="first">
<p>Um parágrafo com 3 span: <span>SPAN A </span><span>SPAN B </span><span>SPAN C</span>
</div>
<div id="second">
<p>* A fonte do parágrafo tem 20pt, e a dos span tem 8pt.</p>
</div>
</body>
</html>
The CSS code:
body{
padding:0;
margin:0;
}
#first{
width:100%;
height:70px;
background-color:green;
border-bottom:4px solid black;
margin-top:-30px;
padding-top:0px;
}
#second{
margin-top:-27px;
padding-top:-5px;
width:100%;
height:70px;
background-color:green;
}
#first p, #second p{
font-family:sans-serif;
font-size:20pt;
font-weight:bold;
}
With this code, my page is the following:
Notice the border separating the 2 DIVs. Also notice the padding-top:0px property of the #first DIV. Now cames my question: If I change this property to padding-top:1px, a strange behavior appears:
Notice that the content of the #first DIV really keeps 1px away of it's top, as expected. But the space between the bottom of the content of the #first DIV and the top of the #second one disappears, and I didn't undertand why.
I would appreciate your help so much. Thanks!
Try this:
CSS
body{
padding:0;
margin:0;
}
#first{
width:100%;
height:70px;
background-color:green;
border-bottom:4px solid black;
padding-top:0px;
}
#second{
width:100%;
height:70px;
background-color:green;
}
#first p, #second p{
font-family:sans-serif;
font-size:20pt;
font-weight:bold;
}
p{
margin: 0px;
line-height: 2.6em;
}
HTML
<div id="first">
<p>Um parágrafo com 3 span: <span>SPAN A </span><span>SPAN B </span><span>SPAN C</span></p>
</div>
<div id="second">
<p>* A fonte do parágrafo tem 20pt, e a dos span tem 8pt.</p>
</div>
DEMO HERE