Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

why not use margin-direction

in the smells like bakin css it uses margin:40px 0px;to set the top and bottom margins simultaneously

then later on in the tutorial were taught about the margin-right:40px; property to set the margin only to one element

how come then after that were taught to set the ul.nav like this margin:120px 0 0 0; instead of margin-top:120px and the same for the new cupcakes id wouldnt it be better to use there specific margin properties than using filling in the unused properties with 0s

ive also noticed he interchangebly uses 0 and 0px wouldnt it be better to impliment a standardized aproach and either use all 0s or all 0pxs

7 Answers

Hey Kyle,

I can see what you are saying how it might get a little confusing and repetitive but I think what he was trying to do is teach you all the different ways you can write the CSS for the properties. It is kinda like once you learn all the different ways, you can pick the one that is comfortable for you to use. Sorry for the confusion

Hope this helps

Dan

ahh i see that clarifies it i just wrote them exactly as he did just incase so far been loving treehouse i already know a bit about making websites but even on the basic tutorial it got up to speed and began teaching me new things just sitting listening to the final tutorials on web domains and stuff waiting for the tutorial to finish cause i already know about those but still ill listen along just incase theres some tidbits of info

That is GREAT Kyle! I am glad I was able to clear that up for you. It is good knowledge to know the different ways to write CSS and pick the one you feel comfortable with.

I am so glad you are enjoying Treehouse. I knew nothing before starting my learning adventure and now I feel I have learned so much and had so much fun getting there. Keep learning those little tidbits, you never know what you will learn.

Dan

thats cool to here that the staff here have also used the service as well and benefited i have not long ago finished the first series and been browsing through the other things and im sorta amazed at the library of content available i was a bit dubious about joining treehouse cause of the price and high promiises being made but thanks to a free trial code from anouther website ive been able to try out the service and plan to carry on using it once my trial period has expired as a paid member its basically a college education (uk college not us )in anything you want all you want and not what you dont want and for $25 a month its cheaper than college my last college course was in computer repair and ran me £1800 just for the tuition not including exam fees and only in one subject that could pay for well over a year and a half of treehouse membership and in that year you could potentially learn the entire treehouse library asuming you put in the same hours you did at college so yes i am throughly amazed with the service and looking forward to the lesson series on starting your own webdesign company

one piece of info for others taking the webdesign courses on here if you check out w3schools they better explain tags than w3c do there not gonna teach you how to use it in a real site porject like treehouse does but theyll atleast show you how to use that particular function your trying to use if you get stuck

oh and congrats on 5k btw

kyle rees -

CSS shorthand shows up in a lot of different properties not just margin, so I think Nick was just showing you that for some properties there are 2 different ways to do it, so you would know what the code was doing when you saw it elsewhere.


thats cool to here that the staff here have also used the service as well and benefited

Treehouse moderators are not employed by Treehouse, we paying members just like yourself, who are just really active on the forum.


check out w3schools they better explain tags than w3c do

Regarding W3Schools, using that site as a reference is considered a worst practice. You can read more about this over at W3Fools

W3Schools is not affliated with the W3C in any way and are using it's trademark without it's permissions.

Instead you should be using:

wow thats a bit on the harsh side yeah i get there not great and there doing some shady stuff but there saying boycott them compleatly im also not thrilled about there concept of wikifying w3s considering that wikify is a euphanism from the site wikipedia and there a shining example of why something shouldnt be "wikified" w3 would be filled with incomplete articles articles needing citations everywhere just plain wrong stuff and god knows what so wikifying wouldnt improve them that much

but i digress ty for the links to html dog dochub and the ones inside of w3 theyve been added to my links file i keep on my desktop filled with all the usefull links i found (note: yes i know about bookmarks but this is my system :) )