I’ve done a part of the project, but now I have a problem with “text-center” class within my HEADs (h1/h2).
I’ve tried a lot of ways but still it doesn’t work and I don’t have any other idea what to do. It had been well before I added the “row” and “col-xs-12” classes.
Just to be honest, I think I don’t really know how DIVISIONs work when there are many of them. I don’t understand it perfectly where should I end it and which ending () is dedicated to which DIVISION…
The problem is that there is no col-xs-12 class. You need to use col-12 instead. see:
Div’s are not too tricky once you get the hang of them. If you are struggling I suggest you break down you code into boxes (on paper) and work out what needs to be inside of what- this might help you start to work out how a page needs to be structured. It will help if you try to properly indent your code for example you have:
<div class="row">
<div class="col-xs-12">
<h1 class="text-center">Leo Messi</h1>
<h2 class="text-center"><em>The King of Football</em></h2>
</div>
<div class="img-thumbnail">
<img id="target1" style="width:100%;" class="img-responsive container-fluid" src="http://e00-marca.uecdn.es/assets/multimedia/imagenes/2016/10/20/14769177854355.jpg" alt="Leo's fingers">
<div class="text-center caption">
<p><p>Leo Messi lifting his fingers after a match. You can guess that he probably had scored a goal before :-D</p>
</div>
</div>
</div>
If you style it like this, then it will be more readably. After a little practice it will become second nature looking at it and you will be able to more easily identify what each div is doing.
<div class="row">
<div class="col-xs-12">
<h1 class="text-center">Leo Messi</h1>
<h2 class="text-center"><em>The King of Football</em></h2>
</div>
<div class="img-thumbnail">
<img id="target1" style="width:100%;" class="img-responsive container-fluid" src="http://e00-marca.uecdn.es/assets/multimedia/imagenes/2016/10/20/14769177854355.jpg" alt="Leo's fingers">
<div class="text-center caption">
<p>
Leo Messi lifting his fingers after a match. You can guess that he probably had scored a goal before :-D
</p>
</div>
</div>
</div>
A couple of tips for indenting on Codepen:
if you click on a div (or another tag), Codepen will underline the corresponding div for you.
if you click on a div (or another tag) and press shift and tab, Codepen will (usually) indent it in the proper place for you.
I would also recommend not using the html and head tags etc on codepen as it not needed. I would also move everything within the style tags into the css section of codepen as it will make it easy to maintain and find faults with you code.
The thing with “col-12” totally helped. I’m a total beginner (it’s been only 3 days since I started my coding adventure) so I hadn’t known about the fact about “clicking on a div”. I think it will help a lot during my further working.
I have also a problem with changing the size of my first heading (h1) text.
I’ve tried something like that:
> h1 {color: black;
> font-family: Monospace;
> font-size: 60px;}
> ```
If you could give me any tip with that I would be glad!