I can center a div in the first Front-end Developer Project?

I can center a div in the first Front-end Developer Project?
0

#1

Hello everyone;
I’m learning Full Stack Developer on freecodecamp and doing the first front-end project.
This is my codepen link: http://codepen.io/borntowin/full/rLwNRQ/

My problem is: I can center the img and the text below. I try some method but can not get expected result.
Please give me an advices!

Thank you


#2

I’m sorry, I don’t understand. Which part do you need centered?

On line 16, you have a class of contain. Should be container.


#3

Thank you for reply. I’ve just found what i need a moment ago.
About you reply i have a question: i have a main .container class wrap all div, should i need another .container class for my text?
One more question: i want my image have a smaller range with the image div; how canni do it? I tried change the style:padding but got no result!

Thankyou again


#4

You shouldn’t be nesting your container classes though, so I would just delete the contain class.

What rules did you use to change the padding?


#5

I just name the div “contain” to easy recognize it :slight_smile
I would like to have more narrow space between my image and the img div. (less white space). I added "style=“padding:1px” " to the img div, but it took no effect.

You can look at the example, i want like this example: https://codepen.io/FreeCodeCamp/full/NNvBQW/


#6

I see! Never mind then.

In CSS, try working with

div.image.col-lg-12 {

}