Solved

Where is the circles - CSS Media Queries

Posted on 2014-10-14
1
240 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

777 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