html - Text-Align: Center - Not Working -


i trying use text-align: center align name on dj website - http://www.jameswinfield.co.uk/v2.html#

however isn't working. have kind of fix using left: 30% looks messy on thinner screens name goes 2 lines , obscures next text section.

i have tried playing display: block , margin: 0 auto neither seem working.

.james {    color: #f235e9;    font-size: 6.25em;    position: fixed;    left: 30%;    top: 28%;    text-transform: uppercase;    font-family: oswald;    letter-spacing: 6px;  }  .und {    color: #f235e9;    font-size: 3.125em;    position: fixed;    left: 35%;    top: 42%;    text-transform: uppercase;    font-family: oswald;  }
<div class="cen">    <div class="james">        <p>james winfield</p>    </div>        <div class="und">        <p>underground house dj</p>      </div>          <ul id="ticker01">      <li><a href="https://www.mixcloud.com/jameswinfield/semi-detached-house/" target="_blank">new house mix released - 18 different house track 18 different years</a>      </li>      <li><a href="https://www.facebook.com/events/1647401842148267/" target="_blank">next djing on 21st august @ purple turtle - midnight 2am (ish) - free entry always</a>      </li>      <li><a href="http://www.residentadvisor.net/dj/jameswinfield/top10" target="_blank">may dj chart uploaded</a>      </li>      <!-- eccetera -->    </ul>  </div>

on thinner screen, looks messy.

you setting position of name using "fixed" relation. use position: relative; , remove fixed top , left attributes element. can set text-align center.

in short:

color: #f235e9; font-size: 6.25em; text-transform: uppercase; font-family: oswald; letter-spacing: 6px; text-align: center; 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -