How can I create three words like say "Information", "Pictures", "Example"?
I want it too be able to stack from top to bottom in the middle of a page and be able to add like Paragraphs, then pictures in the "Picture" section, and add other stuff in the footer of the example sections. I think that part will be my hardest. I also want to be able to make the picture pop up in the screen when you click on it. Yet I have no clue on how to do it. It’s really confusing because i’ve been doing.
I’ve also been trying to add space between them but i can’t figure out how to do that either.
<section class="middle"
<ul>
<li> information </li>
<li> pictures </li>
<li> example </li>
</ul>
and then while styling it
i’ve been doing
.middle ul{
padding:20px;
margin:20px;
}
But i can’t seem to understand what’s going on…
2
Answers
To achieve stacking from top to bottom, you can use the
flex-direction
CSS attribute (https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction). Set the value to "column" to stack your unordered list from top to bottom.For creating a popup effect for an image using JavaScript, consider using a lightbox. Here’s a step-by-step approach:
id
to the list item containing your image.getElementById
(https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById).addEventListener
(https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).You can also check my working example in this fiddle to see if it meets your desired outcome: https://jsfiddle.net/tnxufod9/1/
I would recommend you to get into w3schools. There are heaps of tutorials and explanation that are very suitable for beginners. And explains the stuff you are asking for.
Anyway, I created you a little snippet that does what you wanted:
Open it in full view to see everything alligned correctly.