vendredi 17 avril 2015

Css fix tags position in responsive pages

i have a html page that has many tags. The ones i am trying to style with css are article and nav.



<html>
<body>
<article>(many article inside ths article)</article>
(many tags here)
<nav></nav>
</body>
</html>


I am trying to stile some tags but i don't know css good. First i have to show the text only in 60% of my page so i did this and it works:



body{width: 60%;}


Then i had to show my nav on the left side of my principal article and also it must be 20% width of my page content( And my article the rest of the width). i managed to do it like this but i have the next problem:



article ~ nav{position: fixed;left: 0px;top: 7%; width: 20%;}


The problem is when i resize my browser. The position of my nav is changeing. And i need it to remain fixed (on the left of my article with a width of 20%). I am allowed to change only the css file. The html tags have no classes or id. I managed to do it with bootstrap but i need to do it without bootstrap grid sistem. Can you help please


Aucun commentaire:

Enregistrer un commentaire