Flexbox and rtl - html

I have following layout, but in rtl copy button goes to the left. How do I keep copy button on the right like it was no rtl?
I tried some solutions here but I cannot make it work: flexbox align column left and right
.data {
display: flex; /* displays flex-items (children) inline by default */
align-items: flex-start; /* vertical alignment / optional but recommended / if you don't want that flex-items match in height, which by default they do (default value of stretch, which makes them fill the flex-containers height and where the height of all items is dictated by the height of the "tallest" one) / you can also try the value of center */
max-width: 400px;
direction: rtl;
}
.code {
color: #fff;
margin: 0;
padding: 8px !important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
/*float: left; not necessary*/
}
.copy {
color: #ccc;
/*display: inline-block; not necessary*/
padding: 3px !important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
/*float: right; not necessary*/
margin-left: 10px; /* design purposes */
}
<div class="data">
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
<div class="copy">COPY</div>
</div>

Use the order property.
By default, all flex items are set to order: 0, which means their appearance in the source dictates their order in the layout.
You can change the visual order of flex items using positive and negative integers.
.data {
display: flex;
align-items: flex-start;
max-width: 400px;
direction: rtl;
}
.code {
color: #fff;
margin: 0;
padding: 8px !important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
}
.copy {
order: -1; /* NEW */
color: #ccc;
padding: 3px !important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
}
<div class="data">
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
<div class="copy">COPY</div>
</div>
Here's a more complete explanation and examples: https://stackoverflow.com/a/36118012/3597276
Of course, you can also achieve what you want by simply switching the order of the elements:
.data {
display: flex;
align-items: flex-start;
max-width: 400px;
direction: rtl;
}
.code {
color: #fff;
margin: 0;
padding: 8px !important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
}
.copy {
color: #ccc;
padding: 3px !important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
}
<div class="data">
<div class="copy">COPY</div><!-- now this element is listed first -->
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
</div>

You can just apply flex-direction: row-reverse to your flex container. In this case you don't have to set order for every flex item.
.data {
display: flex; /* displays flex-items (children) inline by default */
align-items: flex-start; /* vertical alignment / optional but recommended / if you don't want that flex-items match in height, which by default they do (default value of stretch, which makes them fill the flex-containers height and where the height of all items is dictated by the height of the "tallest" one) / you can also try the value of center */
max-width: 400px;
flex-direction: row-reverse; /* new */
}
.code {
color: #fff;
margin: 0;
padding: 8px !important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
/*float: left; not necessary*/
}
.copy {
color: #ccc;
/*display: inline-block; not necessary*/
padding: 3px !important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
/*float: right; not necessary*/
margin-left: 10px; /* design purposes */
}
<div class="data">
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
<div class="copy">COPY</div>
</div>
Please note that direction: rtl should be used for languages written from right to left (like Hebrew or Arabic), not for reversing your layout.

Related

Flexbox wont fill the content area

Not sure if flexbox is the correct way of going about this, but basically I am looking for a 2 column flexbox.
In the first part I want to put random text in and the width of this part will adapt and become the same size as the text (whatever the text is).
The second part is a dotted hr line, which I want it to basically take up whatever space is remaining on the right-hand side.
Then there'll be a 16px gap in between. Is this the correct way to go about it? Where am I going wrong?
Thanks for any help, much appreciated !
what i want to happen
Edit: Thanks to everyone who answered, they all worked great tbh, but the solution I chose allowed for some extra flexibility. Again, appreciate everyones time, I don't have enough 'reputation' to upvote everybody! =)
body {
font-family: Montserrat;
background-color: #f0f0f0;
color: #34363e;
}
.main {
height:100%;
width: 100%;
padding: 64px 0;
}
.container {
height:100%;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.h2-container {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
padding: 0 32px 16px;
margin: 0;
width: 1136px;
gap: 16px;
}
.h2-box {
width: 100%;
}
h2 {
text-align: left;
font-size: 27px;
margin: 0;
}
.hr-box {
width: 100%;
}
hr {
border: none;
border-top: 4px dotted #cccccc;
width: 100%;
height: fit-content;
}
p {
text-align: left;
font-size: 16px;
line-height: 24px;
padding: 0 32px;
margin: 16px 0;
}
<div class="main">
<div class="container">
<div class="h2-container">
<div class="h2-box"><h2 class="">This is a title sentance</h2></div>
<div class="hr-box"><hr></div>
</div>
<p class="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo leo, interdum quis auctor at, congue a justo. Donec accumsan nulla id fringilla vulputate. Ut sed mauris pellentesque, venenatis dui quis, consectetur nisl.</p>
</div>
</div>
There are a couple of issue with the implementation. You are heading to the right direction but just need a little bit of a tweak
First of all, remove the width 100% on the h2-box and the dot box.
Add flex-grow: 1; to the dot box and you are good. This will force the element to span the rest of the remaining width.
I am not sure what is expected if your title is more than 1 line long but something to think about for you.
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
Not sure if you meant to set inline-flex, but display flex works just fine.
flex-direction defaults to row so this is not needed
flex-wrap defaults to nowrap so this is also not needed
I am also unsure where you want the dotted line with regards to the title on the left but you can align that vertically with ease using align-items. I have used this in the example below to align the dots to the bottom using align-items: flex-end;
body {
font-family: Montserrat;
background-color: #f0f0f0;
color: #34363e;
}
.main {
height:100%;
width: 100%;
padding: 64px 0;
}
.container {
height:100%;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.h2-container {
display: flex;
padding: 0 32px 16px;
margin: 0;
width: 1136px;
gap: 16px;
align-items: flex-end;
}
h2 {
text-align: left;
font-size: 27px;
margin: 0;
}
.hr-box {
flex-grow: 1;
}
hr {
border: none;
border-top: 4px dotted #cccccc;
width: 100%;
height: fit-content;
}
p {
text-align: left;
font-size: 16px;
line-height: 24px;
padding: 0 32px;
margin: 16px 0;
}
<div class="main">
<div class="container">
<div class="h2-container">
<div class="h2-box"><h2 class="">This is a title sentance</h2></div>
<div class="hr-box"><hr></div>
</div>
<p class="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo leo, interdum quis auctor at, congue a justo. Donec accumsan nulla id fringilla vulputate. Ut sed mauris pellentesque, venenatis dui quis, consectetur nisl.</p>
</div>
</div>
Remove width: 100%; on .h2-box and use either flex: none; or flex: 0 0 auto;.
body {
font-family: Montserrat;
background-color: #f0f0f0;
color: #34363e;
}
.main {
height:100%;
width: 100%;
padding: 64px 0;
}
.container {
height:100%;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.h2-container {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
padding: 0 32px 16px;
margin: 0;
width: 1136px;
gap: 16px;
align-items: center;
}
.h2-box {
flex: none;
/*flex: 0 0 auto;*/
}
h2 {
text-align: left;
font-size: 27px;
margin: 0;
}
.hr-box {
width: 100%;
}
hr {
border: none;
border-top: 4px dotted #cccccc;
width: 100%;
height: fit-content;
}
p {
text-align: left;
font-size: 16px;
line-height: 24px;
padding: 0 32px;
margin: 16px 0;
}
<div class="main">
<div class="container">
<div class="h2-container">
<div class="h2-box"><h2 class="">This is a title sentance</h2></div>
<div class="hr-box"><hr></div>
</div>
<p class="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo leo, interdum quis auctor at, congue a justo. Donec accumsan nulla id fringilla vulputate. Ut sed mauris pellentesque, venenatis dui quis, consectetur nisl.</p>
</div>
</div>
I have another solution... Choose what is better!
You can remove the after your . You will have only the class .h2-box to make the style of your title.
After, you can use the styles for .h2-box :
flex-basis: content;
white-space: nowrap;
width:100%;
The CSS Flexbox property flex-basis lets you specify the desired initial size of a flex item before downsizing or redistributing the remaining space in their Flexbox container.
So you'll have :
body {
font-family: Montserrat;
background-color: #f0f0f0;
color: #34363e;
}
.main {
height:100%;
width: 100%;
padding: 64px 0;
}
.container {
height:100%;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.h2-container {
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
padding: 0 32px 16px;
margin: 0;
width: 1136px;
gap: 16px;
}
.h2-box {
flex-basis: content;
white-space: nowrap;
width:100%;
}
h2 {
text-align: left;
font-size: 27px;
margin: 0;
}
.hr-box {
width: 100%;
}
hr {
border: none;
border-top: 4px dotted #cccccc;
width: 100%;
height: fit-content;
}
p {
text-align: left;
font-size: 16px;
line-height: 24px;
padding: 0 32px;
margin: 16px 0;
}
<div class="main">
<div class="container">
<div class="h2-container">
<h2 class="h2-box">This is a title sentance</h2>
<div class="hr-box"><hr></div>
</div>
<p class="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo leo, interdum quis auctor at, congue a justo. Donec accumsan nulla id fringilla vulputate. Ut sed mauris pellentesque, venenatis dui quis, consectetur nisl.</p>
</div>
</div>
Don't set any widths from .h2-container down, display: flex; will take care of that. Control the size of the flexbox by setting widths, margins, and paddings on the parents, it will fill the parent width. You want the flexbox child that will fill the available space to have flex-grow: 1;.
body {
background-color: #f0f0f0;
color: #34363e;
}
.main {
height: 100%;
width: 100%;
padding: 64px 0;
}
.container {
height: 100%;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.h2-container {
display: flex;
padding: 0 32px;
gap: 16px;
}
.h2-container .grow {
flex-grow: 1;
}
.h2-container h2 {
font-size: 27px;
}
.h2-container hr {
margin-top: 40px;
border: none;
border-top: 4px dotted #cccccc;
}
p {
text-align: left;
font-size: 16px;
line-height: 24px;
padding: 0 32px;
margin: 16px 0;
}
<div class="main">
<div class="container">
<div class="h2-container">
<div>
<h2>This is a title sentence</h2>
</div>
<div class="grow">
<hr>
</div>
</div>
<p class="">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque leo leo, interdum quis auctor at, congue a justo. Donec accumsan nulla id fringilla vulputate. Ut sed mauris pellentesque, venenatis dui quis, consectetur nisl.</p>
</div>
</div>

CSS Tabs>Div hidden behind Container Div

I'm struggling to get my head around what is causing the "tabbed" div to be hidden from view. I can't work out whether it is the content or container div causing this issue.
If you change the ".tabs > div" position from absolute to relative then div class="tabbed" appears as I would like but it causes the content of the tabs stack on top of one another.
Is this a position/z-index or overflow issue?
Any help would be appreciated.
Here is the code:
* {
box-sizing: border-box;
}
body {
background: #fff;
color: #262626;
font: 1em 'PT Sans', sans-serif;
}
::selection {
background-color: #4EC6DE;
}
#content {
padding: 5px 0 5px 0;
position: relative;
overflow: hidden;
}
.container {
position: relative;
clear: both;
width: 100%;
min-height: 350px;
max-width: 1200px;
padding: 5px 0px 5px 0px;
overflow: hidden;
background-color: #ffffff;
}
.pCV {
font-family: 'Libre Baskerville', serif;
font-size: 16px;
line-height: 1.6;
padding: 0;
}
.cvheader {
font-family: 'Libre Baskerville', serif;
font-size: 16px;
font-weight: bold;
}
#textbox {
width: 100%;
border: 1px solid #ccc
}
/* Style buttons */
#downloadbtn {
background-color: #ffffff;
border: 2px solid #262626;
color: #262626;
padding: 12px 12px;
cursor: pointer;
font-size: 20px;
float: right;
margin-top: -50px;
}
/* Darker background on mouse-over */
#downloadbtn:hover {
background-color: #888888;
color: #ffffff;
border: 2px solid #888;
transition: all .8s ease-in-out;
}
.tabbed {
width: 1000px;
margin: 50px auto;
}
.tabbed>input {
display: none;
}
.tabbed>label {
display: block;
float: left;
padding: 12px 20px;
margin-right: 10px;
cursor: pointer;
transition: background-color .3s;
}
.tabbed>label:hover,
.tabbed>input:checked+label {
background: #4EC6DE;
}
.tabs {
clear: both;
perspective: 600px;
}
.tabs>div {
width: 1000px;
position: absolute;
border: 2px solid #4EC6DE;
padding: 10px 30px 40px;
line-height: 1.4em;
opacity: 0;
transform: rotateX(-20deg);
transform-origin: top center;
transition: opacity .3s, transform 1s;
z-index: 0;
}
#tab-nav-1:checked~.tabs>div:nth-of-type(1),
#tab-nav-2:checked~.tabs>div:nth-of-type(2) {
transform: rotateX(0);
opacity: 1;
z-index: 1;
}
#media screen and (max-width: 700px) {
.tabbed {
width: 400px
}
.tabbed>label {
display: none
}
.tabs>div {
width: 400px;
border: none;
padding: 0;
opacity: 1;
position: relative;
transform: none;
margin-bottom: 60px;
}
.tabs>div h2 {
border-bottom: 2px solid #4EC6DE;
padding-bottom: .5em;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.6/prefixfree.min.js"></script>
<div id="content">
<div class="container">
<div class="tabbed">
<input type="radio" name="tabs" id="tab-nav-1" checked>
<label for="tab-nav-1">CV 1</label>
<input type="radio" name="tabs" id="tab-nav-2">
<label for="tab-nav-2">CV 2</label>
<div class="tabs">
<div>
<div id="textbox">
<h2 class="cvheader">EDUCATION</h2>
<a href="ArtistCV.pdf" download>
<button id="downloadbtn"><i class="fa fa-download fa-fw"></i> Download</button></a>
<div style="clear: both;"></div>
</div>
<p class="pCV">Maecenas dictum, urna ut consequat condimentum, est dui commodo diam, ac pretium dui ante eu quam. </p>
</div>
<div><h2>CSS</h2><p>Maecenas dictum, urna ut consequat condimentum, est dui commodo diam, ac pretium dui ante eu quam. Curabitur posuere metus nec tellus venenatis placerat. Ut egestas neque in odio vulputate gravida. In at justo ac est laoreet eleifend vel quis arcu. Aliquam erat volutpat. Proin vitae vehicula neque. Nam tempus erat ac ante tincidunt tincidunt. Pellentesque eu nibh sapien. Nunc augue magna, lacinia eget congue eget, mattis id tortor. Fusce id vestibulum neque. Proin tincidunt tellus ut risus lobortis cursus. Duis sit amet urna vel sapien ullamcorper varius.</p></div>
</div>
</div>
</div>
</div>
I'm struggling to get my head around what is causing the "tabbed" div to be hidden from view.
You have mistake in your HTML markup. Change this:
Download</button</a>
To this:
Download</button></a>
And add this to your CSS:
.container {
min-height: 350px;
}
If you don't want to set min-height manually, then you'll need to use JS to calculate it dynamically. Hardly imagine doing this with pure CSS.

2 fluid block elements side by side share space

I have 2 elements which hold text, both are unknown width and I dont want to add fixed width to copy div.
How do I make them float in one line and always occupy 100% width together? (without tables)
.data{
max-width:400px;
}
.code {
color: #fff;
margin: 0;
padding: 8px!important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
float: left;
}
.copy {
color: #ccc;
display: inline-block;
padding: 3px!important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
float: right;
margin-top: 1px;
}
<div class="data">
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
<div class="copy">COPY</div>
</div>
You can do it with the Flexbox:
.data {
display: flex; /* displays flex-items (children) inline by default */
align-items: flex-start; /* vertical alignment / optional but recommended / if you don't want that flex-items match in height, which by default they do (default value of stretch, which makes them fill the flex-containers height and where the height of all items is dictated by the height of the "tallest" one) / you can also try the value of center */
max-width: 400px;
}
.code {
color: #fff;
margin: 0;
padding: 8px !important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
/*float: left; not necessary*/
}
.copy {
color: #ccc;
/*display: inline-block; not necessary*/
padding: 3px !important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
/*float: right; not necessary*/
margin-left: 10px; /* design purposes */
}
<div class="data">
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
<div class="copy">COPY</div>
</div>
Use can use flexible box to deal with this. Just need to add display:flex in your .data. For more info, please read here
.data{
max-width:400px;
display:flex;
}
.code {
color: #fff;
margin: 0;
padding: 8px!important;
line-height: 1.2;
font-size: 11px;
background: #bbb;
border: 1px solid #333;
word-wrap: break-word;
float: left;
}
.copy {
color: #ccc;
display: inline-block;
padding: 3px!important;
font-size: 12px;
cursor: pointer;
border: 1px solid #999;
float: right;
margin-top: 1px;
}
<div class="data">
<p class="code">Praesent molestie. Nunc Venenatis Sapien Ultrices Dui. Vivamus dolor. Integer vel ante. Proin felis. Maecenas non nisl eu mi hendrerit fringilla.</p>
<div class="copy">COPY</div>
</div>

CSS - Left Menu

I must preface this post by saying my CSS isn't great!
I have a page with a menu on the left, which is essentially an unordered list, wrapped in a div to apply the CSS
<div class="leftMenu" id="jobMenu">
<ul>
<li ng-click="menuClick(1)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(2)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(3)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(4)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(5)">
<p>Menu Item</p>
</li>
<li ng-click="menuClick(6)">
<p>Menu Item</p>
</li>
</ul>
</div>
Menu CSS:
.leftMenu {
display: block;
text-align: center;
float: left;
height: 94vh;
border: 1px solid #778390;
width: 120px;
background-color: #778390;
color: white;
}
.leftMenu ul {
margin-top: 0;
list-style: none;
padding: 0;
}
.leftMenu li {
text-align: center;
border-bottom: 1px solid #58626B;
padding-bottom: 18px;
padding-top: 18px;
cursor: pointer;
font-size: 14px;
}
.leftMenu li:hover {
background-color: #5d9eca;
}
.leftMenu li p {
margin: 0;
font-family: 'Roboto', sans-serif;
font-weight: 300;
font-size: 13px;
}
On the right hand side, I have a main page, with a Kendo Grid (the issue occurs no matter what the content is).
<div class="bottomSection">
<kendo-grid options="mainGridOptions">
</kendo-grid>
</div>
CSS:
.bottomSection {
display: block;
padding: 12px 15px;
/*float: right;*/
width: 84.5%;
height: 60%;
/*margin-right: 66px;*/
}
On most displays, the layout renders perfectly, like so:
However if I resize the window and/or zoom in, the bottomSection div is thrown under the left menu like so:
How can I make it so whenever the window is resized, the leftMenu always stays at 120px width and the bottomSection div resizes itself, so they both stay side by side no matter what size the window is? I would have thought using the percentage as a width property would achieve this?
Thanks in advance!
.leftMenu {
display: block;
text-align: center;
position: absolute;
left: 0;
top: 0;
height: 94vh;
border: 1px solid #778390;
width: 120px;
background-color: #778390;
color: white;
}
.bottomSection {
display: block;
padding: 12px 15px;
width: 100%;
padding-left: 135px;
height: 60%;
box-sizing: border-box;
}
Let me preface my solution by suggesting that you use a percentage for your left menu also, so that mobile devices would have a good experience. With a fixed width on one div, and a percentage on the other, you're bound to have layout problems.
With that said, if you're constrained to use a fixed with for the left menu, here's a solution - I've cut out some of the markup, to focus on the major layout aspects:
html, body {
margin: 0;
padding: 0;
}
.container {
width: 100%;
position: relative;
}
.leftMenu {
background-color: #333;
color: #FFF;
height: 200px; /* for demo purposes */
width: 120px;
position: relative;
}
.bottomSection {
background-color: #CCC;
color: #FFF;
padding: 10px;
position: absolute;
left: 120px;
right: 0;
}
.leftMenu, .bottomSection {
display: inline-block;
vertical-align: top;
}
<html>
<head>
</head>
<body>
<div class="container">
<div class="leftMenu">Menu</div>
<div class="bottomSection">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec cursus congue hendrerit. Phasellus luctus quam in nulla mollis finibus. Quisque feugiat, metus sit amet porta fringilla, elit odio sodales mauris, sed gravida turpis felis vitae turpis. Mauris interdum ac magna vel pretium. Nulla porta rutrum velit mollis congue. Proin pellentesque urna et magna lacinia, et tincidunt mi placerat. Nulla suscipit rhoncus viverra. Integer pulvinar at purus non tristique.
</div>
</div>
</body>
</html>
Points to note:
Using display: inline-block for layout instead of float.
A parent div (container) is used: must be set to position: relative (or possibly absolute).
Using absolute for positioning of bottomSection. left is set to 120px (to ignore the left menu); right is set to 0, to stretch to the other side of the screen.
vertical-align is set to top, to keep alignment of the child divs to the top.

Html positions of article aside and divs

Hi i have problem with positions of this tags
I have this code
<div class="wrap">
<div class="site-content">
<article class="col-sm-12 col-lg-8 article">
<div class="post-content">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce interdum tincidunt sodales. Fusce euismod viverra eros sit amet porttitor. Aenean purus neque, tempus quis diam in, scelerisque pellentesque leo. Suspendisse nec molestie erat. Duis faucibus, tellus eget pretium ullamcorper, turpis ante finibus mi, sed accumsan libero elit nec urna. Phasellus odio lectus, interdum eu vehicula a, malesuada vel tellus. Suspendisse sit amet ullamcorper nibh. Nullam fermentum mi sed malesuada ullamcorper. Etiam et lacinia elit. Mauris pellentesque nunc sapien, id ultricies magna venenatis non. Phasellus volutpat leo ac diam bibendum placerat. Vestibulum elementum, ex a tempor bibendum, nibh neque egestas enim, vel aliquet nisl turpis vel ligula. Sed sagittis dolor id metus ultrices tristique a nec nibh. Curabitur hendrerit rutrum dui, at placerat nisl rutrum ut. Duis vitae semper nunc, non aliquet sapien.
</p>
</div>
</article>
<aside class="col-sm-12 col-lg-4 aside-panel">
<h3 class="caption">Most read posts</h3>
<div class="top-post">
<div class="top-post-image">
<a href="#">
<img src="img/aside1.png" alt="">
</a>
</div>
<span class="post-info">28. November 2014</span>
<span class="separator">//</span>
<span class="post-info">Iphone</span>
<a class="top-post-title" href="#">Etiam lorem orci hendrerit ac neque id interdum fringilla metus</a>
</div>
<div class="top-post">
<div class="top-post-image">
<a href="#">
<img src="img/aside3.jpg" alt="">
</a>
</div>
<span class="post-info">28. October 2014</span>
<span class="separator">//</span>
<span class="post-info">Huawei</span>
<a class="top-post-title" href="#">Pellentesque tincidunt consequat nibh at vestibulum</a>
</div>
</aside>
</div><!-- end of .site-content -->
</div><!-- end of .wrap -->
problem is: my wrap have height:0px but why? i have my content in wrap... and second problem is: why text after tag is not under all of my content?
Here is my CSS:
html{
height: 100%;
}
/* Blocks */
div.container{
padding: 0;
width:100%;
}
/* Post */
article.article{
position: static;
font-size: 16px;
line-height: 28px;
float: left;
}
article.article p{
text-align: justify;
margin-bottom: 28px;
}
.aside-panel{
position: static;
}
.post-intro{
position: absolute;
color:#fff;
bottom: 0;
left: 0;
width: 100%;
}
.post-content:after, .post-content:before{
content: " ";
display: table;
}
.info{
font-size: 17px;
font-style: italic;
width: 100%;
color: #eee;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
}
.info-left{
left:0;
float: left;
}
.info-right{
right:0;
float: right;
}
.perex{
font-size: 20px;
margin: 10px 0 30px 0;
font-style: italic;
}
.intro-image{
min-width: 100%;
width: 100%;
height: 550px;
max-width: 1000px;
background-repeat: no-repeat;
background-position: center;
}
.overlay{/* Image overlay */
position: relative;
height: 100%;
background-color: rgba(32,32,32,.7);
}
.search{
position: absolute;
width: 300px;
margin:80px 0 10px 0;
right: 0;
}
.search .searchbox{
width: 255px;
background: transparent;
font-size: 22px;
padding: 0 25px;
color: #fff;
font-weight: bold;
outline: none;
border: 1px solid rgba(238,238,238,.3);
height: 45px;
}
.search .submit{
width:45px;
height: 45px;
border: 0;
border: 1px solid rgba(238,238,238,.3);
border-left: 0;
float: right;
background: transparent;
color: #a9a9a9;
font-size: 22px;
}
.searchbox:focus{
border: 1px solid #fff;
}
.searchbox:focus ~ .submit{
border: 1px solid #fff;
border-left: 0;
color: #fff;
}
.focused{
border: 1px solid #fff;
}
.fieldset-default{
border: 1px solid #c0c0c0;
}
/* Change color of placeholder when input is focused */
.searchbox:focus::-webkit-input-placeholder {color: #fff;}
.searchbox:focus:-moz-placeholder {color:#fff;opacity:1;}
.searchbox:focus::-moz-placeholder {color:#fff;opacity:1;}
.searchbox:focus:-ms-input-placeholder {color:#fff;}
.post-brand{
/*change for bigger logo */
position: absolute;
width: 350px;
margin:80px 0 10px 0;
color:#fff;
left:0;
line-height: 45px;
font-size: 40px;
}
.search fieldset{
padding: 0;
}
/* Navigate bar/box */
.box{
height: 50px;
width: 100%;
background-color: rgb(0,0,0);
}
.no-format{
text-decoration: none;
color: inherit;
}
.no-format:hover{
text-decoration: none;
color: inherit;
}
.box.box-top{
top:0;
}
.box .logo{
color:white;
font-family: 'Lobster', cursive;
font-size: 32px;
float: left;
}
.box .spacer{
width: 1px;
height:30px;
margin: 10px 30px;
background: white;
float:left;
}
/* Default definition of box item */
.box-item{
padding: 0 15px;
color:#919090;
float: left;
line-height: 47px;
display: block;
font-weight: bolder;
z-index: 999;
}
.box-item:hover{
padding: 0 15px;
color:#fff;
float: left;
line-height: 47px;
display: block;
font-weight: bolder;
text-decoration: none;
}
/* Aside with top articles */
.top-post{
margin-bottom: 20px;
}
.top-post-image{
margin-bottom: 5px;
height: 170px;
overflow: hidden;
}
.top-post-image img{
width: 100%;
height: auto;
}
.post-info{
color: #888787;
font-size: 13px;
}
.separator{
color: #888787;
font-size: 13px;
font-style: italic;
}
.horizontal-divider{
border-bottom: 1px solid #626262;
border-top: 1px solid #626262;
height: 4px;
}
.top-post-title{
display: block;
font-weight: 600;
text-decoration: none;
color: #111;
font-size: 19px;
}
.top-post-title:hover{
display: block;
font-weight: 600;
text-decoration: none;
color: #111;
}
/* Wrappers */
.wrap{
position: relative;
width:100%;
margin:auto;
max-width: 1100px;
}
.box .wrap{
height: 50px;
}
.site-content{
position: absolute;
height: auto;
}
Here you have my complete code: HERE
Look at text after comment
Its because you have positioned .site-content absolutely. Position it relatively.
.site-content{
position: relative;
height: auto;
}
Updated Fiddle
Make the following correction:
Remove position:absolute from .site-content
Add overflow:hidden to .wrap
I have tested it. Let me know if you have any further doubts or queries.
my sugestion is:
.site-content{
position:relative;
min-height:100%;
overflow:hidden;}
i use it and this work for me.