Site logo

Archived topic

Center title on page

4 replies · Started by Elwin Hoover on November 1, 2014

Viewing posts 1–5 of 5

Tom,

How do I center the title of the page on the site? Also, how to do I center my Youtube video?

Hi Elwin,

This CSS should do it for you.

.entry-header {
      text-align: center;
}

As for your YouTube video, you'll need to surround it like this:

<div style="text-align: center;">
YOUTUBE CODE IN HERE
</div>

Hope this helps :)

Thanks, Tom. I tried it and it didn't work, so I just used this code:

<center><iframe src="//www.youtube.com/embed/oZFP8WBxWVA?rel=0&controls=0&showinfo=0" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></center>

When I view the Youtube video on my iphone, , it doesn't conform to the phone...it's just really long. How do I make it responsive on mobile?

Thank you so much!
E

Tom,

I just want to center the title on the home page. And probably the contact page. How can I be choosy with which pages get a centered title and which ones don't?

For the homepage, you can do this:

.home .entry-header {
      text-align: center;
}

For the contact page, you'll need to find the unique class given to that page.

It will be attach to the tag in the source, and will look like this: page-id-xx.

The best way to find it is to use Chrome - right click and select "Inspect Element". Now find the <body> tag (near the top) - there will be a class like the above in their, with the unique number for that page.

Then you just add this:

.page-id-xx .entry-header {
      text-align: center;
}

By default, videos are responsive on mobile devices.

Can you post your link to the page with the video so I can take a look?

This archived topic is closed to new replies.