0

How can I center paragraphs, buttons on a page? I did it via text-align and centered, but I just can't figure out how to center it vertically too... I achieved it with padding but the position changes depending on resolution and I'm really looking for it to stay centered in the middle of the 'block' at any screen size.

I got a jsfiddle showing you what I have! http://jsfiddle.net/82V8Y/#share

This is the main issue..

<div id="block1">
<p class="name">Portfolio</p>
<p class="title"> IT / BUSINESS / WEB</p>

<button class="cv">Download CV</button>


</div>
user3241019
  • 811
  • 9
  • 20

2 Answers2

0

It's not good idea to center entire page vertically. You don't never know what device (resolution) does viewer use. If you aren't doing apps like Google spreadsheets, the page must stay vertically expandable because width of content is dependent on device/browser.

0

i was trying your code and you can do this, as simple it seems,

<div id="block1">
    <p class="name">Portfolio</p>
    <p class="title"> IT / BUSINESS / WEB</p>
    <p class="title">
    <button class="cv">Download CV</button>
    </p>    
</div>

<div id="block2">
    <p class="title">block 2</p>
</div>

<div id="block3">
    <p class="name">block 3</p>
</div>

i only added a "p" area but inside it is your botton try it and it works, and for the others you can duplicate this

you can create a new style for the other tittles, follow the logic that you have already and change the color, or the size of your titles, standarize your development, is a good way to begin, i hope i helped you!!

MickyScion
  • 526
  • 2
  • 14