Código fonte de exemplo para o vídeo Como Centralizar Uma Div Dentro de Outra Div com CSS do canal Curso de Programação com Ulysses Alves
Last active
September 27, 2023 23:50
-
-
Save UlyssesAlves/f8dbe2267a0742de3ccaa81aca34a66f to your computer and use it in GitHub Desktop.
Como centralizar uma <div> dentro de outra <div> usando CSS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#divExterna { | |
width: 100%; | |
} | |
/* Primeira alternativa para centralizar a DIV. */ | |
#divInterna { | |
width: 50%; | |
margin: 0 auto; | |
background-color: yellow; | |
} | |
/* Segunda alternativa para centralizar a DIV. */ | |
#divInterna { | |
display: table; | |
margin: 0 auto; | |
background-color: yellow; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Centralizando uma DIV dentro de outra DIV</title> | |
<link rel="stylesheet" type="text/css" href="centralizando_divs.css"></link> | |
</head> | |
</body> | |
<div id="divExterna"> | |
<div id="divInterna"> | |
Conteúdo da DIV interna. | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment