• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

I cant seem to center my images on a web page

New Here ,
Feb 12, 2017 Feb 12, 2017

Copy link to clipboard

Copied

Hi All,

Be gentle, this is my first post.

So Im trying to learn about webpages and stuff so i have created a site https://www.tomwelsh.eu from the templates section of Dreamweaver but I cant for the life of me get the image and title to center.

Can some one tell me what Im missing here?

Here is the snippet

      <div class="row">

        <div class="col-lg-4">

          <img class="img-circle" src="images/life.jpg" alt="Life" width="140" height="140" class="img-circle">

          <h2>Life</h2>

          <p>"some blurb that i put here.</p>

          <p><a class="btn btn-default" href="/life.html" role="button">View details &raquo;</a></p>

        </div><!-- /.col-lg-4 -->

        <div class="col-lg-4">

But it looks like this

So how can i get that image and title centered?

All help gratefully received

Chers

Tom

Views

289

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Feb 12, 2017 Feb 12, 2017

OK, So I worked it out.

I needed to use "center-Block" for the image and text-center" for the heading giving me the following..

<div class="row">

        <div class="col-lg-4">

          <img class="center-block img-responsive img-circle" src="images/life.jpg" alt="Life" width="140" height="140" class="img-circle">

  <div class="text-center"><h2>Life</h2></div>

                   <p>bla bla bla.</p>

          <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>

        </di

...

Votes

Translate

Translate
New Here ,
Feb 12, 2017 Feb 12, 2017

Copy link to clipboard

Copied

OK, So I worked it out.

I needed to use "center-Block" for the image and text-center" for the heading giving me the following..

<div class="row">

        <div class="col-lg-4">

          <img class="center-block img-responsive img-circle" src="images/life.jpg" alt="Life" width="140" height="140" class="img-circle">

  <div class="text-center"><h2>Life</h2></div>

                   <p>bla bla bla.</p>

          <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>

        </div><

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 12, 2017 Feb 12, 2017

Copy link to clipboard

Copied

LATEST

You dont need the 'img-circle' class applied twice to your image. Infact I'm surprised DW has not flagged up an error, maybe it has but you have not seen it.

<img class="center-block img-responsive img-circle" src="images/life.jpg" alt="Life" width="140" height="140" class="img-circle">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines