The document provides instructions for creating an HTML blog layout and styling with CSS. It describes adding div elements to structure content areas like headers, articles, and a Twitter widget. CSS code is provided to style each div by setting widths, colors, borders etc. Styling techniques like floats, margins and shadows are demonstrated. The goal is to create a multi-article blog layout with formatted text, images and embedded content.
1. HTML workshop
checklist
1. background image 1280 x 1000 pixels
2. personal headshot 320 x 380 pixels
3. twitter account to create a widget
4. an image for a blog post 300 x 200 pixels
2. Put your directory folder onto the
desktop
should contain:
index.html
style.css
image folder (with images)
everything should be linked and working
you can download my example if you donāt
have one of your own
ā¢
ā¢
ā¢
ā¢
ā¢
3. To create the blog we must define a
content area
1. we do this on the html document using
<div></div> tags to wrap content
4. To create the blog we must define a
content area
1. we do this on the html document using
<div></div> tags to wrap content
2. then we need to add an attribute to each
<div></div> tag so we can call each out
separately on our CSS doc
5. To create the blog we must define a
content area
1. we do this on the html document using
<div></div> tags to wrap content
2. then we need to add an attribute to each
<div></div> tag so we can call each out
separately on our CSS doc
3. <div id=āwrapperā> stuff here </div>
6. Hereās what the HTML code looks
like:
<body>
<div id=āwrapperā>
Hello World!
<img src=āimages/evanHead.jpgā />
</div>
</body>
7. Hereās what the corresponding CSS
code looks like:
#wrapper {
width: 800px;
}
8. Hereās what the corresponding CSS
code looks like:
#wrapper {
width: 800px;
margin: 0px auto;
}
11. Now letās add more content
1. change āHello Worldā to the name of our
blog: Race, Class, and Gender in Digital
Culture
2. Wrap our blog title in <h1></h1> tags
<h1>Race, Class, and Gender in Digital Culture</h1>
12. Now letās style our <h1> tags on CSS
h1
{
font-family: futura, arial, san-serif;
}
13. Now letās style our <h1> tags on CSS
h1
{
font-family: futura, arial, san-serif;
font-size: 48px;
}
14. Now letās style our <h1> tags on CSS
h1
{
font-family: futura, arial, san-serif;
font-size: 48px;
color: #ffffff;
}
17. Now letās add more formatting tags
ā¢
To create nice margins, the easiest way is to
create another container inside of our <div
id=āwrapperā></div>
18. Now letās add more formatting tags
<div id=āwrapperā>
<div id=āheaderā>
<h1>Race, Class, and Gender in Digital Culture</h1>
<img src=āimages/evanHead.pngā />
</div>
</div>
19. Now we must style our āheaderā div
#header {
width: 700px;
}
20. Now we must style our āheaderā div
#header {
width: 700px;
margin: 0px auto;
}
21. Things are looking good, but...
ā¢
We must add some formatting tags
This time wrap a <div></div> tag around
your headshot and call it something
contextual
22. Adding a <div id=āevanHeadā>
<div id=wrapperā
<div id=āheaderā>
<h1>Race, Class, and Gender in Digital Culture</h1>
<div id=āevanHeadā>
<img src=āimages/evanHead.pngā />
</div>
</div>
</div>
25. Now letās create a Twitter Widget
ā¢
Google āTwitter Widgetā
ā¢
Click
ā¢
Log-in
26. Now letās create a Twitter Widget
ā¢
Click āCreate Newā
ā¢
Establish specs
ā¢
Save and create
ā¢
Copy code
27. Paste embed code into index.html
<div id=āwrapperā>
<div id=āheaderā>
<h1>Race, Class, and Gender in Digital Culture</h1>
<div id=āevanHeadā
<img src=āimages/evanHead.pngā />
</div>
paste twitter embed code here
</div>
</div>
28. Now letās style our Twitter Widget
ā¢
The code looks like craziness, so sometimes
Google is your friendā¦
29. Now letās style our Twitter Widget
ā¢
ā¢
I found this one thread that says I can style
the widget by using the ID twitter-widget-0
on my CSS.
Letās try it!
34. Take a look...
ā¢
Add a right-side margin to #evanHead
#evanHead
{
width: 320px;
height: 380px;
background-color: rgba(230, 230, 230, .8);
border-radius: 20px;
overflow: hidden;
float: left;
margin-right: 40px;
}
35. Now We Can Work On Blog Articles
ā¢
How do you think we start this process?
36. Now We Can Work On Blog Articles
ā¢
ā¢
create a new div on index.html.
we can call this div āarticleOneā
<div id=āarticleOneā>
</div>
37. Placing the articleOne <div>
<div id=āwrapperā>
<div id=āheaderā>
<h1>Race, Class, and Gender in Digital Culture</h1>
<div id=āevanHeadā
<img src=āimages/evanHead.pngā />
</div>
Twitter
</div>
<div id=āarticleOneā>
</div>
</div>
38. Add content to articleOne div
<div id=āarticleOneā>
<img src=āimages/futurityNow.jpgā />
copy text from wiki here
</div>
39. Now we need to style articleOne
ā¢
Where do we start?
40. Now we need to style articleOne
#articleOne
{
width: 700px;
margin: 0px auto;
}
41. Now we need to style articleOne
#articleOne {
width: 700px;
margin: 0px auto;
background-color: rgba(230, 230, 230, .8);
}
42. Now we need to style articleOne
#articleOne {
width: 700px;
margin: 0px auto;
background-color: rgba(230, 230, 230, .8);
border-radius: 20px;
}
43. Now we need to style articleOne
#articleOne {
width: 700px;
margin: 0px auto;
background-color: rgba(230, 230, 230, .8);
border-radius: 20px;
margin-top: 40px;
}
44. Now we need to style articleOne
ā¢
ā¢
ā¢
How do we create margins?
Create a <div></div> within article one to
create nice margins and borders (itās easy!)
Call this <div id=āinnerArticleOneā></div>
47. Letās Format The Article
ā¢
Letās add <p></p> tags to each paragraph
<p>
Fuchs, Christian. Internet and Society: Social Theory in the Information
Age. New York: Routledge, 2008. 105-18. Print
</p>
48. We Need to Get to FuturityNow
ā¢
Can do this using a class
<img src=āimages/futurityNow.jpgā class=āfuturityā />
49. Now Letās Style class=āfuturityā
On CSS stylesheet:
.futurity {
float: left;
}
50. Now Letās Style class=āfuturityā
On CSS stylesheet:
.futurity {
float: left;
margin-top: 15px;
}
51. Now Letās Style class=āfuturityā
On CSS stylesheet:
.futurity {
float: left;
margin-top: 15px;
margin-right: 15px;
}
52. Letās add a class to our first PP
ā¢
First paragraph:
<p class=āparagraphOneā>
content
</p>
57. Letās create articleTwo
ā¢
Under the </div> for articleOne, but inside
the <div id=āwrapperā> create:
<div id=āarticleTwoā
</div>
58. Letās grab content for articleTwo
1. grab Prezi embed code - ideally your own,
but any will do for this example.
1. grab a paragraph of text from a reading
response.
59. Paste content into <div id=āarticleTwoā
1. Paste Prezi embed code and paragraph into
div:
<div id=āarticleTwoā>
Prezi code
text text
</div>
63. Styling articleTwo
ā¢
ā¢
On CSS, copy the code for #articleOne and
#innerArticleOne
Paste below and change the name to reflect
the divs you created: #articleTwo &
#innerArticleTwo
66. Letās add a few more details
ā¢
space between article two and the wrapper?
67. Letās add a few more details
ā¢
space between article two and the wrapper?
#wrapper
{
width: 800px;
margin: 0px auto;
background-color: rgba(204, 204, 204, .8);
border-radius: 20px;
padding-bottom: 15px;
}
68. Letās add a few more details
ā¢
drop shadows on the articles?
69. Letās add a few more details
ā¢
drop shadows on the articles?
ā¢
Add to the article divs
box-shadow: 5px 5px 5px #333333;