I am facing an issue with media queries. I am trying to set the width
property of a container to 100%
of the page, but it is not working as expected. I am using Bootstrap as my CSS framework. Here's a snippet from the inspector:https://i.sstatic.net/PaUzk.png
Code:
<div class="container-flex" id="blog-posts">
<div class="post-left">
<div>
<img class="img-responsive" src="images/content/blog/post-image.jpg">
</div>
</div>
<div class="divider">
<div class="divider-dot"></div>
<div class="divider-line"></div>
</div>
<div class="post-right">
<div>
<time>10 April 2014</time>
<h3>Typi non habent claritatem insitam</h3>
<p>Duis autem vel eum iriure dolor in hendreit in vulputate velit esse molestie consequat vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui [...]</p>
</div>
</div>
</div>
CSS:
@media only screen and (max-width : 767px) {
#blog-posts {
display: flex;
flex-direction: column;
width: 100%;
border: 1px solid blue;
.divider {
display: none;
}
.post-left {
;
width: 100%;
div {
//width: 100%;
border: 1px solid;
}
}
.post-right {
width: 100%;
div {
width: 100%;
border: 1px solid;
}
}
}
}
...
#blog-posts {
display: flex;
.post-left {
width: 47.95%;
//border: 1px solid blue;
div {
width: 50%;
float: right;
img {
float: right;
}
}
}
.divider {
//border: 1px solid;
width: 4.1%;
.divider-dot {
border-radius: 50%;
background-color: rgb(235, 235, 235);
width: 17px;
height: 17px;
margin: 0 auto;
}
.divider-line {
width: 1px;
height: 100%;
background-color: rgb(235, 235, 235);
margin: 0 auto;
}
}
.post-right {
//border: 1px solid green;
width: 47.95%;
div {
width: 50%;
time {
font-size: 16px;
font-family: "Raleway";
color: rgb(123, 108, 99);
line-height: 1.875;
text-align: left;
}
h3 {
font-size: 24px;
font-family: "Raleway";
color: rgb(33, 33, 33);
line-height: 1.25;
text-align: left;
}
p {
font-size: 16px;
font-family: "Raleway";
color: rgb(148, 148, 148);
line-height: 1.875;
text-align: left;
}
}
}
}