Solved

Where is the circles - CSS Media Queries

Posted on 2014-10-14
1
243 Views
Last Modified: 2014-10-14
Hi E's,
I'm taking the first steps in CSS Media Queries, in this case about screen orientation, landscape and portrait.
I list some articles in side bar in my blog, and I need to divide each article name by one circle.
In landscape, I present articles inblock, like this:landscapeIn portrait I try to present the articles inline, like this:portraitThe problem was the portrait part, the circles disappeared! Is supose the circles divide each article name, in this case inline.
This is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Media Queries</title>
<style>
.articles{width: 500px; margin-left: auto; margin-right: auto; margin-top: 300px;}
.link_listar_articles{text-align: center;}
@media screen and (orientation:portrait) {
        .articles a{display: inline;}
        .circulos{width: 10px; height: 10px; background: black; border-radius: 50%; behavior: url(PIE.htc);}
}
@media screen and (orientation:landscape) {
        .articles a{display: block;}
        .circulos{width: 10px; height: 10px; background: black; border-radius: 50%; behavior: url(PIE.htc); margin-left: auto; margin-right: auto;}
}
</style>
</head>
<body>
<div class="articles">
<a class="link_listar_articles" href="praias-douradas-mas-ventosas"><i>praias douradas mas ventosas</i></a>
<a class="circulos"></a>
<a class="link_listar_articles" href="grandes-ferias"><i>grandes ferias</i></a>
<a class="circulos"></a>
<a class="link_listar_articles" href="lorem-ipsum"><i>Lorem ipsum pt</i></a>
<a class="circulos"></a>
<a class="link_listar_articles" href="comida-marroquina"><i>comida marroquina</i></a>
<a class="circulos"></a>
</div>
</body>
</html>

Open in new window

What changes I have to do for the circles appear also in portrait orientation?
The best regards, JC
0
Comment
Question by:Pedro Chagas
1 Comment
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 40380974
Replace this:

.articles a{display: inline;}

with this:

.articles a{display: inline-block;}
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question