-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog.html
146 lines (138 loc) · 9.29 KB
/
blog.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html><html lang="en-US"><head>
<title>Majd Murad</title>
<LINK REL="SHORTCUT ICON" HREF="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/ArteMasksLogo.png?raw=true"/>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="default.css">
<link rel="stylesheet" type="text/css" href="./blog/blog-stylesheet.css">
</head><body>
<nav>
<span id="majd">Majd Murad</span>
<a id="current_page" class="nav" href="http://creatyvtype.github.io">Home</a>
<a class="nav" href="http://creatyvtype.github.io">About Me</a>
<a class="nav" href="./blog/t2-css-design.html" target=_blank>Blog</a>
<a class="nav" href="http://creatyvtype.github.io">Tech</a>
<a class="nav" href="http://artemasks.com">Mask Making</a>
<a class="nav" href="http://creatyvtype.github.io">Theatre</a>
<form id="search" action="/search" method="get" autocomplete="off">
<input name="q" type="text" placeholder="search" value tabindex="1" autocomplete="off" maxlength="240">
</form>
</nav>
<aside>
<img id="selfie" src="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/Gravatar.JPG?raw=true"/>
<a href="http://github.com/creatyvtype"<img class="social_link" id="github" src="./github_logo/png/github-mark-64px.png"/></a>
<a href="https://www.linkedin.com/pub/majd-murad/4a/a16/907" target="blank"><img class="social_link" id="linkedin" src="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/LinkedInLogo.png?raw=true"/></a>
<a href="https://twitter.com/ShaikhMajdi" target=_blank><img class="social_link" id="twitter" src="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/TwitterLogo.png?raw=true"/></a>
<a href=mailto:[email protected]?subject=From%20Your%20Website><img class="social_link" id="gmail" src="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/gmaillogo.png?raw=true"/></a>
</aside>
<div id="main_body">
<div id="blog_head">
<div id="blog_head_text">
<a id="blog_title" href="http://creatyvtype.github.io/blog/t2-css-design.html">Majd's Blog</a>
<h2 id="blog_subtitle">I'm Obse<span class="red">CSS</span>ed</h2>
<h4 id="blog_date">Sun 3/8/15</h4>
</div>
<a class="button" id="left" href="http://creatyvtype.github.io/blog/t2-css-design.html"><</a>
<a class="button" id="right" href="http://creatyvtype.github.io/blog/c1-chefs-kitchen.html">></a>
</div>
<div id="blog_archive">
<h3>Blog Archive</h3>
<ul id="arch_list">
<li><a href="http://creatyvtype.github.io/blog/t2-css-design.html">
I'm ObseCSSed<br><span class="archive_date">
3/8/15</span></a></li>
<li><a href="http://creatyvtype.github.io/blog/c1-chefs-kitchen.html">
Chefs in the Kitchen<br><span class="archive_date">
2/28/15</span></a></li>
<li><a href="http://creatyvtype.github.io/blog/t1-git-blog.html">
You Git!<br><span class="archive_date">
2/27/15</span></a></li>
</ul>
</div>
<div id="blog_entry">
<p>
I learned SO MUCH this week. This bootcamp is supposed to be 15-25 hours a week. I spent about 40 hours because I was researching so dang much. Here's the gist:
</p>
<p>
CSS. It means Cascading Style Sheets. It's applied to a basic html page by linking them like this in the html file. If CSS file is called example.css:
<p>
<link rel="stylesheet" type="text/css" href="example.css">
</p>
This goes into your <head> tag.
</p>
<p>
The hardest thing I had to learn in CSS was about boxes and how to move them. So every element in HTML is a box. Everything. An image is a box. This paragraph is a box within my box for paragraphs. EVERYTHING IS A BOX. This is super important to remember because boxes inside boxes is how you move everything around.
</p>
<p>
<img id="box_example" src="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/BoxesExample.png?raw=true"/>
In this example, you can see these boxes. Imagine the Yellow sidebar having words or logos. Either way, boxes. There's a header, and a footer, and a body. Basic layout for a basic page. I would start by making sure in the HTMl code that every box is a part of a bigger box that's easy to manipulate. For example, the header is one box, then a box for the body that includes BOTH the yellow and red boxes, then the footer box. The yellow box then has the three orange boxes, which since they're in a row, are easy to manipulate with no more sub-boxing.
</p>
<p>
The red body box, however, is a little trickier. You could put them all in and hope they stack right, or you could divide it again so you just deal with the two on the left and the two on the right, or the two on top and the two on bottom. It just depends on what they'll be used for. If it makes more sense for the left/right coupling based on the content you'll put in, then go for it.
</p>
<p>
Phew! Boxes boxes boxes. Reminds me of chemistry in high school (my teacher had this method of converting units using boxes you would draw, and he'd always say "Boxes boxes boxes". Heheh. Anyways...)
</p>
<p>
Now for the better stuff. Displays and positioning. Here's the information I learned that might make things easier since no one site can just give basics (except for <a href="http://learn.shayhowe.com/">this one</a>, which is where I learned most of this stuff in the end.)
</p>
<p>
Display Basics: block, inline, inline-block
</p>
<ul>Block
<li>Width starts at 100%, can be changed</li>
<li>Next block item starts a new line</li>
<li>Float property will only work with this</li>
<li>Good for header/footer. Big horizontal stretches.</li>
<li>This is already preset as standard for most big box elements</li>
</ul>
<ul>Inline
<li>Takes width of content</li>
<li>Other inline boxes will line up directly to left or right of this as organized in HTML file.</li>
<li>Really only good for a few words, like bars on the navigation bar (although there's a really good <nav> tag you can use).</li>
<li>These can't have fixed sizes for width and height</li>
</ul>
<ul>Inline-Block (the best!)
<li>Behaves like a Block element</li>
<li>Dimensions can be set</li>
<li>All elements with this display will set up in line right next to the previous one until the edge of the box containing them, then they'll start a new line</li>
<li>PERFECT for the float property</li>
<li>Whitespace becomes an issue... remove by connecting the tags like this "</element><element>" with no space in between, or fabricate the space using a comment marker like this: "</element><!-- comment if you want -->" This takes care of most whitespace issues, but play with it.</li>
</ul>
<p>
Positioning Basics: static, fixed, relative and absolute
</p>
<p>Static: Default
</p>
<ul>Fixed
<li>Relative to browser</li>
<li>This is the fun one where when you scroll, the box stays in the same place!</li>
</ul>
<ul>Relative
<li>Means relative to its own static position</li>
<li>Use "left/right/top/bottom: value(px/em)"</li>
<li>Will overlap with other elements, not moving them in the process.</li>
<li>Doesn't make other things wrap around it like text</li>
</ul>
<ul>Absolute
<li>Will move in relation to its direct parent element (not itself) if the parent element is also not static.</li>
<li>Its original space isn't preserved, so other things can occupy that space.</li>
</ul>
<p>
Float, mentioned above, when given the value left or right, will move all the way to the left/right of its container. Kind of handy!
</p>
<p>
<img id="margin_pic" src="https://github.com/creatyvtype/creatyvtype.github.io/blob/master/imgs/boxmodel.gif?raw=true"/>
Margins borders and padding. So every element actually has the properties in the above photo. When you set a width and height, it only affects the inner box. When you add padding, a border, or margin, it adds to the total box dimensions. Example, if you set a box with a width of 10px, add a border of 2px (will add twice on each side), and a margin of 5px (will add twice on each side), your new box width is actually 24px! THAT'S why it's moving all those other boxes on your friggin' screen! There's only one solution to this... a -webkit-box-sizing property you can set to "content-box/padding-box/border/box". It sets is so the width and height actually starts at the property you set, but it still doesn't reach the margins! These will still be added.
</p>
<p>
One last important note: IDs and Classes. When you're making your various boxes, big or small, and you want to position them, but you've called on them all using the <div> element, when you try to style div in your stylesheet, all of them are going to move! For that, we set the tag with an ID or a Class. ID will change that SPECIFIC box in html it looks like: <div id="name_your_id_here"> and close it regularly. In CSS, to change it, you put: #name_your_id_here {} and continue. Classes works similarly, but can apply to multiple elements of that class. Set it the same way as ID in html, just use "class" instead of "id". In CSS, however, you call it with this: .class_name {}. Good? NOW GO FORTH AND CODE!
</p>
<p>
Phew. Again.
</p>
</div>
</div>
<footer>
© Copyright 2015 Majd Murad
</footer>
</body></html>