centrer element css code example

Example 1: css align center

//HTML
Hello World
//CSS .parent { display: flex; justify-content: center; align-items: center; }

Example 2: mettre une image au milieu css

IMG.displayed {
    display: block;
    margin-left: auto;
    margin-right: auto }
 ...
...

Example 3: center text css

p {
  text-align: center;
}

Example 4: aligner et centrer element css html



.navigation{
  width: 100%;
  height: 1.8em;
  
}

li {
  display: inline;
  padding:5px;
  
}
////////////////////////////////////////////////////
 
portrait portrait_demo portrait_demo
//////// css/////////// .portrait{ text-align: center; } .demo_portrait_1{ padding:10px; height: 400px; width: 400px; }

Tags:

Misc Example