Jump to content

Media Queries


dianaemanuel
 Share

Recommended Posts

Boas,

media queries permitem definir um teste associado a um determinado estilo.

Esse estilo só será aplicado se esse teste for válido.

Este exemplo aplica o estilo do example.css apenas quando a página tem no máximo 800px de largura

<link rel="stylesheet" media="(max-width: 800px)" href="example.css" />

https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

Link to comment
Share on other sites

Boas,

Eu tenho uma página onde alguns controlos têm um estilo aplicado, por exemplo:

<style type="text/css">
    .auto-style1 {
	    width: 252px;
	    margin-left: 361px;
	    margin-top: 239px;
    }
    .auto-style2 {
	    margin-bottom: 90px;
    }
    .input,.label{font-weight:700;}
    .auto-style3 {
	    margin-left: 13px;
	    margin-top: 3px;
    }
</style>

Para cada media querie que eu criar tenho que voltar a repetir este código e ajustá-lo consoante o tamanho do ecrã?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.