L006. margins

on CLOUD 9 || graphics & layouts tutorials
Please Subscribe to read the full chapter

margins

 

 

 

1. Margins shift groups away from their natural position, so when I add a margin-left of 50px, the object shifts 50px away from the left. The same works for margin-right, margin-top and margin-bottom as well.
 

<div style="float:left;margin-left:50px;width:200px;height:200px;"><img alt="" src="http://i.imgur.com/8Izc35f.png" style="width:200px;height:200px;" />div>


 

 

 

2. Margins can also be used to separate different objects/groups.
 

<div style="float:left;width:200px;height:200px;"><img alt="" src="http://i.imgur.com/8Izc35f.png" style="width:200px;height:200px;" />div>

<div style="float:left;margin-left:50px;width:200px;height:200px;"><img alt="" src="http://i.imgur.com/8Izc35f.png" style="width:200px;height:200px;" />div>


 

 

 

3. Margins work with negative values as well. For example,
 

<div style="float:left;width:200px;height:200px;"><img alt="" src="http://i.imgur.com/8Izc35f.png" style="width:200px;height:200px;" />div>

<div style="float:left;margin-left:-50px;width:100px;height:100px;"><img alt="" src="http://i.imgur.com/8Izc35f.png" style="width:100px;height:100px;" />div>

 

Notice the second <div> group has a margin-left of -50px. Hence, the seco

Please Subscribe to read the full chapter
Like this story? Give it an Upvote!
Thank you!

Comments

You must be logged in to comment
LilMinMinniexx
#1
I'm currently learning how the coding works here (since there are quite a lot of code pieces that don't work here.) These are pretty good guides :)
gagnant
#2
Chapter 4: hi?
can I ask you how to make this one "like this story? give it an upvote"
schneizel
#3
i'm not a beginner, but i really need this to learn how to use more textures and stocks, and omf.
thanks for this; i'll be waiting for more!

also, may i request typography? it's always been a matter that i've been struggling with.
Vonchic
#4
Chapter 11: You have, by far, the most helpful tutorials I've seen around! Seriously, I've been reading coding tutorials these days and I still had questions left hanging even after I read those tuts! I think it's because you're not just showing one way to do something but that you're showing what happens if you do this and not that. I'm looking forward to your scrollbar tut as I'm having problems making the scrollbar transparent on top of a background image. I know it will take a long time before we even get to that tutorial but I'm hoping it's one of things you will address! Thank you and have a good day!