Responsivness:div resizes depending on inline div - html

First div element is facing downwards,i've had this kind of problem and could not understand it, i'm just making simple grid layout 24% | 50% | 24% but as you see first div is doing weird thing, if you solve it and explain why this phenomenon happens and am i doing this simple grid correctly please give your opinions,thanks in adnvance.
html {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
border: 0;
font-size: 25px;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
.nav-top {
width: 100%;
background-color: #f00000;
}
.row {
width: 100%;
display: inline-block;
color: #fff;
border: 1px solid gray;
}
.row p {
font-size: 90%;
float: left;
}
.nav-top-col-sm {
width: 24%;
display: inline-block;
}
.nav-top-col-sm span {
float: right;
}
.nav-top-col-lg {
width: 50%;
display: inline-block;
background-color: black;
}
<nav class="nav-top">
<div class="row">
<div class="nav-top-col-sm">
<span>En</span>
</div>
<div class="nav-top-col-lg">
<p>FB,Twitter,Google,Wifi,Youtube</p>
<p>market</p>
</div>
<div class="nav-top-col-sm">
<p>My Account</p>
</div>
<!-- Col-->
</div>
<!-- Row -->
</nav>

When you set the display property to inline or inline block, you should set
vertical-align: middle; for them.
Also u dont need to set the width to 24% to get them on one line.
U need to set the font size:0 on the parent, and give individual font sizes to each inline-block.
This happens because, the inline blocks have some white-space, which pushes them on next line, when 25% width is given.
html {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
border: 0;
font-size: 25px;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
.nav-top {
width: 100%;
background-color: #f00000;
}
.row {
width: 100%;
display: inline-block;
color: #fff;
border: 1px solid gray;
}
.row p {
font-size: 90%;
float: left;
}
.nav-top-col-sm {
width: 24%;
display: inline-block;
vertical-align: middle;
font-size: 20px;
}
.nav-top-col-sm span {
float: right;
}
.nav-top-col-lg {
width: 50%;
display: inline-block;
background-color: black;
vertical-align: middle;
font-size: 20px;
}
<nav class="nav-top">
<div class="row">
<div class="nav-top-col-sm">
<span>En</span>
</div>
<div class="nav-top-col-lg">
<p>FB,Twitter,Google,Wifi,Youtube</p>
<p>market</p>
</div>
<div class="nav-top-col-sm">
<p>My Account</p>
</div>
<!-- Col-->
</div>
<!-- Row -->
</nav>

Related

keep space between div's

I want show a html div wich contains a state-descritpiton with a circle (green or red). This circle shows the state of the enigne in the right corner of the description.
My problem is the following. If the windows size has changed (smaler), the description and the "state-circle" overlap each other.
How can i prevent this?
Do you know how the css-code should be?
structure is mainly this:
.statusdiv{
height: 40px;
}
.statusbeschreibung{
position: absolute;
margin-left: 40%;
}
.statuskreis {
position: absolute;
width: 25px;
height: 25px;
top: 13px;
/*left: 190px;*/
margin-left: 60%;
border: 1px solid black;
text-align: center;
border-radius: 12.5px;
}
.status-on{
background-color: green;
}
.status-off{
background-color: red;
}
<div class="list-block">
<ul>
<li>
<div class="statusdiv">
<p class="statusbeschreibung">Motorstatus</p>
<div name="motorstatus" id="motorstatus" class="item-link statuskreis status-off"></div>
</div>
</li>
</div>
This was based on your original screenshot images of your code: basically you should use display:inline-block instead of position:absolute to prevent your bullet from overlapping your text, and then use a margin-left on the bullet so that it always has enough space between it and the text.
.list-block ul {
padding: 0;
margin: 0;
}
.list-block li {
list-style: none;
}
.statusdiv {
white-space: nowrap;
}
.statusbeschreibung {
margin-left: 40%;
display: inline-block;
vertical-align: middle;
}
.statuskreis {
width: 25px;
height: 25px;
margin-left: 10px;
border: 1px solid black;
text-align: center;
border-radius: 12.5px;
display: inline-block;
vertical-align: middle;
}
.status-on {
background-color: green;
}
.status-off {
background-color: red;
}
<div class="list-block">
<ul>
<li>
<div class="statusdiv">
<p class="statusbeschreibung">Motorstatus</p>
<div name="motorstatus" id="motorstatus" class="item-link statuskreis status-off"></div>
</div>
</li>
<li>
<div class="statusdiv">
<p class="statusbeschreibung">Motorstatus</p>
<div name="motorstatus" id="motorstatus" class="item-link statuskreis status-on"></div>
</div>
</li>
</ul>
</div>
If I'm understanding it correctly, you style the circle with the class "motortatus".
Try to set the width and height in percentages, not in pixels. This should resize the status circle and prevent it from overlapping with the description, except the font of the description doensn't resize at all and fills up the whole div.
I love inline lists for this sort of thing, but you can also do columns in your preferred css framework of choice.
I've styled it so each of the two list items is 50% of the width of the ul container, but you can tweak those as you see fit.
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.statusdiv {
list-style: none;
float: left;
margin: 0;
padding: 1em;
width: 100%;
color: #2d2d2d;
}
.statusdiv li {
width: 50%;
float: left;
padding: 0 1em;
}
.statusdiv li:first-child {
text-align: right;
height: 35px;
line-height: 35px;
}
.statusdiv li:last-child {
text-align: left;
}
.circle {
content: "";
background-color: aqua;
width: 35px;
height: 35px;
display: inline-block;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
}
<!-- EDIT THIS SNIPPET -->
<ul class="statusdiv">
<li>
Status thing:
</li>
<li><span class="circle"></span></li>
</ul>

Why does block with text shift to bottom?

Why does block with text shift to the bottom? I know how to fix this issue (need to add "overflow: hidden" to the box), but I don't understand why it shift to the bottom, text inside the box is short, margins in browser-inspector are same as margins of example without text.
Example of the problem
HTML:
<div class="with-text">
<div class="box1">
SIMPLE TEXT
</div>
<div class="box2">
</div>
</div>
<div class="without-text">
<div class="box1">
</div>
<div class="box2">
</div>
</div>
CSS:
html, body {
font-size: 10px;
margin: 0;
height: 100%;
}
.box1 {
display: inline-block;
margin: 5px;
width: 50px;
height: 50px;
background: blue;
/* Fix the problem */
/* overflow: hidden; */
color: white;
}
.box2 {
display: inline-block;
margin: 5px;
width: 50px;
height: 50px;
background: red;
}
.with-text:before {
display: block;
content: "with-text";
text-transform: uppercase;
margin: 1rem;
}
.with-text {
box-sizing: border-box;
height: 50%;
border: 1px solid;
}
.without-text:before {
display: block;
content: "without text";
text-transform: uppercase;
margin: 1rem;
}
.without-text {
box-sizing: border-box;
height: 50%;
border: 2px solid black;
}
The problem is that by default vertical alignment of inline elements – baseline,
The text inside element affects it and pushes div to the bottom.
Use vertical-align: top to solve issue.
You can try to add vertical-align:
.box1 {
display: inline-block;
margin: 5px;
width: 50px;
height: 50px;
background: blue;
/* overflow: hidden; */
color: white;
vertical-align:top;
}

ParentA Child Expands Parent, ParentB Child does not. Exact Same Setup

Terrible title, I know.. it's just different than any other "Child expanding outside of parent" problem I've ever had or saw.
Anyway, I have two children with the same structure and same CSS applied to both.
HTML:
<div id='base'>
<div id='banner'>
Link 1
Link 2
Link 3 with longer width
Link 4
Link 5 dif size
Link 6
</div>
<form id='form'>
<div>
<div class='col-6-'>
<p>dd</p>
<!--<p>dsadosih doijasd oouhvodus ouhfoiusdif oiudhaoudd
oinoiuasd onhasoiduf ou oud oijod</p>-->
</div>
<div class='col-6-'>
<p>dsadosih doijasd oouhvodus ouhfoiusdif oiudhaoudd
oinoiuasd onhasoiduf ou oud oijod</p>
<br>
<p>dsadosih doijasd oouhvodus ouhfoiusdif oiudhaoudd
oinoiuasd onhasoiduf ou oud oijod</p>
</div>
</div>
</form>
</div>
CSS:
*
{
margin: 0;
padding: 0;
-ms-box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html, body
{
height: 100%;
color: #0068ac;
}
body {
text-align: center;
background: #689976;
}
.col-6-{width: 48%;}
body
{
background: gray;
}
#base
{
display: inline-block;
padding-top: 5%;
height: 90%;
/* width: 90%; */
}
#form
{
height: 98%;
background: #E6F0F7;
border-radius: 0 0 5px 5px;
}
#banner a
{
text-decoration: none;
outline: none;
display: block;
float: left;
font-size: 12px;
line-height: 36px;
position: relative;
padding: 0 10px 0 60px;
color: #ffe143;
background: #32a252;
height: 2em;
}
.col-6-
{
display: inline-block;
}
#form div div
{
text-align: left;
vertical-align: top;
padding: 1%;
}
#form div p
{
word-break: break-all;
}
I've never tried to share a jsfiddle, but hopefully this works: https://jsfiddle.net/12rLb42a/
Bottom Line
As you can see there are two divs at 48% width of the parent. The second div contains two p's that wrap within the 48% space and don't breach it.
If you uncomment the p element in the first div, you will see that is not the case for that one because it does expand the parent. Why is this happening?

vertical align middle divs with float right & left

I have a user name and photograph that appears side by side and middle aligned, as shown below.
I am now trying to change the css so that the photo is dynamically floated to the left and the user name is dynamically floated to the right.
I have tried adding float: right and float left to the css but this only makes the photograph appear under the user name.
I have read several similar threads and tried many things, but I cannot solve this. It is really frustrating. It may be a simple fix, but I cannot see it.
Using CSS, how do I display the username on the right and the photo on the left and still have the user name and photo vertical-align: middle with a width of 100%? The photo that the user uploads can be different height, so I cannot use line-height.
Here is my HTML code:
<div class="resumeStyleResumeTitleWrapper17">
<div class="resumeStyleResumeTitle17">
<div class="resumeStyleResumeTitleInner17">
<div class="resumeStyleResumeTitleFontChange17">User Name</div>
</div>
<div class="resumeStyleResumeTitlePhotograph17">
<div class="resumeStyleResumeTitlePhotographInner17">
{# image has max-height: 149px & max-width: 149px; assigned in the css file #}
<img class="name_details_photograph_preview_dimensions" src="{{ image_url }}" />
</div>
</div>
</div>
</div>
Here is my css code:
.resumeStyleResumeTitleWrapper17 {
display: table-cell;
width: 100%;
}
.resumeStyleResumeTitle17 {
background-color: #000;
color: #fff;
direction: ltr;
display: table-cell;
float: left;
text-align: left;
width: 100%;
}
.resumeStyleResumeTitleInner17 {
background-color: #000;
color: #fff;
direction: ltr;
display: table-cell;
max-height: 149px;
padding: 2px;
text-align: left;
vertical-align: middle;
width: 100%;
}
.resumeStyleResumeTitleFontChange17 {
direction: ltr;
font-size: 32px;
font-weight: bold;
text-align: left;
text-transform: uppercase;
width: 100%;
}
.resumeStyleResumeTitlePhotograph17 {
background-color: #000;
color: #fff;
direction: ltr;
display: table-cell;
max-height: 149px;
max-width: 149px;
padding: 2px;
text-align: right;
vertical-align: middle;
}
.resumeStyleResumeTitlePhotographInner17 {
display: inline-block;
vertical-align: middle;
}
.name_details_photograph_preview_dimensions {
max-height: 149px;
max-width: 149px;
}
Here is one way of doing it using CSS3 transforms to take care of the vertical alignment of the name/title element.
I defined two classes, .flipLeft and .flipRight to control the placement of the name/title and the image elements.
I assumed that the image height will be as tall or taller than the height of the name/title, otherwise, things get more complicated.
The trick is to use the text-align property to place the image to the left or to the right of the parent block.
I then use absolute positioning to take the name/title element out of the content flow and pin it to the opposite edge of the parent block and adjust the top offset to 50% to get approximate vertical centering.
Finally, I use CSS3 transforms to adjust for the height of the name/title element.
Note: In the snippet below, scroll vertically to see both examples.
.resumeStyleResumeTitleWrapper17 {
display: block;
width: auto;
border: 1px dotted blue;
}
.resumeStyleResumeTitle17 {
background-color: #000;
color: #fff;
position: relative;
}
.resumeStyleResumeTitleFontChange17 {
font-size: 32px;
font-weight: bold;
text-align: left;
text-transform: uppercase;
}
.resumeStyleResumeTitlePhotograph17 {
border: 1px dotted yellow;
display: inline-block;
vertical-align: top;
}
.resumeStyleResumeTitlePhotographInner17 {
}
.name_details_photograph_preview_dimensions {
max-height: 149px;
max-width: 149px;
display: block;
}
.flipLeft.resumeStyleResumeTitle17 {
text-align: left;
}
.flipLeft .resumeStyleResumeTitleInner17 {
border: 1px dotted yellow;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
}
.flipRight.resumeStyleResumeTitle17 {
text-align: right;
}
.flipRight .resumeStyleResumeTitleInner17 {
border: 1px dotted yellow;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
<h2>Flip Image to Left</h2>
<div class="resumeStyleResumeTitleWrapper17">
<div class="resumeStyleResumeTitle17 flipLeft">
<div class="resumeStyleResumeTitleInner17">
<div class="resumeStyleResumeTitleFontChange17">User Name</div>
</div>
<div class="resumeStyleResumeTitlePhotograph17">
<div class="resumeStyleResumeTitlePhotographInner17">
<img class="name_details_photograph_preview_dimensions" src="http://placehold.it/140x100" />
</div>
</div>
</div>
</div>
<h2>Flip Image to Right</h2>
<div class="resumeStyleResumeTitleWrapper17">
<div class="resumeStyleResumeTitle17 flipRight">
<div class="resumeStyleResumeTitleInner17">
<div class="resumeStyleResumeTitleFontChange17">User Name</div>
</div>
<div class="resumeStyleResumeTitlePhotograph17">
<div class="resumeStyleResumeTitlePhotographInner17">
<img class="name_details_photograph_preview_dimensions" src="http://placehold.it/140x100" />
</div>
</div>
</div>
</div>
Couldn't achieve it with float but I got the desired layout using display: flex;
JS Fiddle
div.container {
display: flex;
width: 100%;
align-items: center;
background-color: black;
height: 100px;
padding: 20px 0;
}
div.user_name {
display: flex;
font-size: 32px;
font-family: Helvetica;
color: white;
width: 50%;
padding-left: 20px;
}
div.user_img {
display: flex;
justify-content: flex-end;
width: 50%;
height: 100%;
padding-right: 20px;
}
div.user_img > img {
height: 100%!important;
width: auto;
}
<div class="container">
<div class="user_name">User Name</div>
<div class="user_img">
<img src="http://www.lessons4living.com/images/penclchk.gif"/>
</div>
</div>
Found a fix for this problem, update your HTML to following,
<div class="resumeStyleResumeTitleWrapper17">
<div class="resumeStyleResumeTitle17">
<div class="resumeStyleResumeTitlePhotograph17">
<div class="resumeStyleResumeTitlePhotographInner17">
<img class="name_details_photograph_preview_dimensions" src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTWd99Qkjbg4ZVu-XHvaIo4LX1MittAmD0CvsiN6QcYeuv4XOQm" />
</div>
</div>
<div class="resumeStyleResumeTitleInner17">
<div class="resumeStyleResumeTitleFontChange17">User Name</div>
</div>
</div>
</div>
In CSS,
.resumeStyleResumeTitleWrapper17 {
width: 100%;
}
.resumeStyleResumeTitle17 {
background-color: #000;
color: #fff;
direction: ltr;
float: left;
text-align: left;
width: 100%;
height: 150px;
}
.resumeStyleResumeTitleInner17 {
background-color: #000;
color: #fff;
direction: ltr;
max-height: 149px;
padding: 2px;
text-align: left;
display: inline-block;
vertical-align: middle;
}
.resumeStyleResumeTitleFontChange17 {
direction: ltr;
font-size: 32px;
font-weight: bold;
text-align: left;
text-transform: uppercase;
width: 100%;
}
.resumeStyleResumeTitlePhotograph17 {
background-color: #000;
color: #fff;
direction: ltr;
max-height: 149px;
max-width: 149px;
text-align: right;
vertical-align: middle;
display: inline-block;
}
.resumeStyleResumeTitlePhotographInner17 {
}
.name_details_photograph_preview_dimensions {
max-height: 149px;
max-width: 149px;
}
.resumeStyleResumeTitle17:before{
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -2px;
}
Basically I added a .resumeStyleResumeTitle17:before element which acts like a ghost element and takes the full height and allows each adjacent elements to be aligned by display:inline-block and now vertical-align:middle property is applicable.
Ok, this is to point you in the right direction, but it is obvious that you don't really understand what is going on. You have way too many div's there and really bad naming structure on the classes. Here is how I got it working somewhat in the direction you want without removing the divs and starting over (which is what I would do otherwise): ( Here is the live jsfiddle for it).
<!DOCTYPE HTML>
<style>
.resumeStyleResumeTitleWrapper17 {
position:relative;
width: 100%;
display:block;
background-color: #000;
height:175px;
}
.resumeStyleResumeTitle17 {
background-color: #000;
color: #fff;
direction: ltr;
text-align: left;
width: 100%;
}
.resumeStyleResumeTitleInner17 {
background-color: #000;
color: #fff;
direction: ltr;
float:right;
width: 100%;
}
.resumeStyleResumeTitleFontChange17 {
font-size: 32px;
font-weight: bold;
text-align: right;
text-transform: uppercase;
float:right;
}
.resumeStyleResumeTitlePhotograph17 {
background-color: #000;
color: #fff;
direction: ltr;
}
.resumeStyleResumeTitlePhotographInner17 {
float:left;
height:175px;
}
.name_details_photograph_preview_dimensions {
max-height: 149px;
max-width: 149px;
}
</style>
<div class="resumeStyleResumeTitleWrapper17">
<div class="resumeStyleResumeTitle17">
<div class="resumeStyleResumeTitleInner17">
<span class="resumeStyleResumeTitleFontChange17">User Name</span>
</div>
<div class="resumeStyleResumeTitlePhotograph17">
<!-- image has max-height: 149px & max-width: 149px; assigned in the css file -->
<img class="name_details_photograph_preview_dimensions" src="http://www.lessons4living.com/images/penclchk.gif" />
</div>
</div>
</div>
</html>

divs move when resizing the page

I have a timeline on a site I'm trying to recreate and when I resize the window to mobile, the divs get separated. I'm a little far into the site and am very cautious about what I need to do to make this work. The timeline has icons (which have their own div) & a icon background (which have their own div too) but I think I need to wrap them around in one larger div to make this work, but not sure how.
See images here for a before I resize and after I resize:
See how the icons get separated from the background?
Html code for each item in timeline:
<div class="timeline_item">
<div class="timeline_time"><p><em>1 hr ago</em></p></div>
<div class="icon_background"></div>
<div class="timeline_icon "><i class="ss-icon">doc</i></div>
<div class="timeline_text"><p>You read the article </p> </div>
</div>
CSS:
.timeline_item {
width: 100%;
padding-bottom: 17%;
}
.timeline_item .timeline_time {
float: left;
width: 20%;
}
.timeline_item .timeline_icon {
float: left;
width: 1%;
}
.timeline_item .timeline_text {
float: left;
width: 65%;
padding-left: 3%;
}
.timeline_icon {
margin-left: -4%;
margin-top: 2.5%;
}
Without access to a proper Jsfiddle Demo, here's one suggestion with a reduced HTML structure which uses pseudo-elements.
You could use an icon-font, sprite or whatever where I have used a single letter.
Codepen Demo
HTML
<div class="timeline">
<article class="timeline_item">
<div class="timeline_time">
<p>1 hr ago<p>
</div>
<div class="timeline_text" data-event-type="doc"><p>You read the article </p> </div>
</article>
<article class="timeline_item">
<div class="timeline_time">
<p>1 hr ago<p>
</div>
<div class="timeline_text" data-event-type="alert"><p>You have a 'Do Not Miss' Meeting scheduled for tomorrow 9a.m.</p> </div>
</article>
<article class="timeline_item">
<div class="timeline_time"><p>1 hr ago<p>
</div>
<div class="timeline_text" data-event-type="video"><p>You watched a video</p> </div>
</article>
</div>
CSS
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
.timeline {
width:50%;
margin: 1rem auto;
border:1px solid lightgrey;
}
.timeline_item {
display: table;
width:100%;
}
.timeline_time,
.timeline_text {
display: table-cell;
padding:1rem 2rem;
}
.timeline_time {
width:25%;
text-align: right;
border-right:1px solid lightgrey;
}
.timeline_text {
position: relative;
}
[data-event-type]:before {
position: absolute;
content:"";
width:32px;
height:32px;
line-height: 32px;
text-align: center;
color:white;
left:0;
top:0;
border-radius: 50%;
transform:translate(-50%,50%);
}
[data-event-type="doc"]:before {
content:"D";
background: #00f;
}
[data-event-type="alert"]:before {
content:"A";
background: #f00;
}
[data-event-type="video"]:before {
content:"V";
background: #0f0;
}
The techniques shown here might help you wit your current issue(s).
There are, of course, alternatives to this layout method, including floats and actual tables. some of those will require 'fixes' to achieve the 'equal heights' that is native to CSS tables.
Since there was no complete html or css, this is a mobile first approach that requires fairly decent css skills to follow, but it starts off in a logical way for small viewports and adjusts fluidly. The min-width is where the layout for larger view ports starts. The styles before this are global (shared by all view port sizes).
DEMO: http://jsbin.com/zerijo/1/
http://jsbin.com/zerijo/1/edit
CSS:
/*demo only body */
body {
font-family: sans-serif;
background:#fff;
padding:5%;
}
/* ---------- timeline styles ------------ */
.timeline_wrapper:after, .timeline_item:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.timeline_wrapper, .timeline_item {
display: inline-block
}
* html .timeline_wrapper, * html .timeline_item {
height: 1%
}
.timeline_wrapper, .timeline_item {
display: block
}
.timeline_wrapper,
.timeline_wrapper div,
.timeline_wrapper *:before,
.timeline_wrapper *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.timeline_wrapper {
position: relative;
padding-top: 10px;
line-height: 1.5;
}
.timeline_wrapper:before {
position: absolute;
top: -5px;
bottom: 10px;
left: 15px;
content: "";
height: 100%;
display: block;
border-right: 1px solid #777;
width: 1px;
z-index: -1;
}
.timeline_wrapper p {
margin: 0
}
.timeline_icon i {
background: red;
display: block;
border-radius: 50%;
width: 30px;
height: 30px;
line-height: 32px;
text-align: center;
font-size: 15px;
color: #fff;
float: left;
}
.timeline_text {
float: left;
width: 100%;
padding: 0 0 0 40px;
}
.timeline_time {
padding-left: 40px
}
.timeline_item {
width: 100%;
position: relative;
}
.timeline_item:not(:last-child) {
padding-bottom: 30px;
}
#media (min-width:480px) {
.timeline_wrapper {
position: relative;
padding-top: 10px;
}
.timeline_wrapper:before {
left: 27%
}
.timeline_item > div {
float: left;
position: relative;
}
.timeline_time {
width: 22%;
text-align: right;
padding: 0;
left: -10%;
}
.timeline_icon {
width: 10%;
min-height: 50px;
left: 22%;
top:-5px;
}
.timeline_icon i {
margin: 0 auto;
float: none;
}
.timeline_text {
float: left;
width: 100%;
margin-left: -37%;
padding: 0 0 0 37%;
}
}
HTML -- structured differently for mobile then adjusted position at the min-width:
<div class="timeline_wrapper">
<div class="timeline_item">
<div class="timeline_icon">
<i class="your-icon"></i>
</div>
<div class="timeline_time">
<p><em>1 hr ago</em></p>
</div>
<div class="timeline_text">
<p>Lack of peppering one's sentences with gerunds.Lack of peppering one's sentences with gerunds. Lack of peppering one's sentences with gerunds. You read the article </p>
</div>
</div>
<div class="timeline_item">
<div class="timeline_icon">
<i class="your-icon"></i>
</div>
<div class="timeline_time">
<p><em>1 hr ago</em></p>
</div>
<div class="timeline_text">
<p>You read the article Lack of peppering one's sentences with gerunds. Lack of peppering one's sentences with gerunds.Lack of peppering one's sentences with gerunds.Lack of peppering one's sentences with gerunds.</p>
</div>
</div>
<div class="timeline_item">
<div class="timeline_icon">
<i class="your-icon"></i>
</div>
<div class="timeline_time">
<p><em>1 hr ago</em></p>
</div>
<div class="timeline_text">
<p>You read the article.</p>
</div>
</div>