About the cube

By crisp on Friday 01 December 2006 00:20
Category: Other, Views: 639

What's up with the cube in my weblog-'design'?

I'm not much of a designer but I didn't want my blog to have one of the default WordPress themes either. Because I'm not a designer I decided to not even try to make a design so I just kept it real simple. Some things are still remaining from the original Kubrich theme I took as a basis but I might minimize those away as well.

The only real style-element is the cube on the left in the header (only visible in CSS-capable browsers) which was something I came across when I recalled the 'slantastic' demo from Eric Meyer and went to look for some more examples.

I found the cube on Claire Campbell's site about style and CSS design and found it intriguing. The original markup and css of the example was like this:


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
<style type="text/css">
#cubecontainer {
    width120px;
    margin1em auto;
    text-aligncenter;
}
.cubedraw {
    line-height:0px;
    width:0px;
    height:0px;
    margin0px;
    font-size0px;
    border-style:solid;
}
.c1 {
    border-colorwhite white blue white;
    border-width0px 60px 45px 60px;
}
.c2 {
    border-colorblue lime white red;
    border-width45px 60px 0px 60px;
}
.c3 {
    border-colorwhite lime white red;
    border-width0px 60px 0px 60px;
    height20px;
}
.c4 {
    border-colorwhite red white white;
    border-width0px 60px 45px 0px;
    floatleft;
}
.c5 {
    border-colorwhite white white lime;
    border-width0px 0px 45px 60px;
    floatleft;
}
</style>
<div id="cubecontainer">
    <div class="cubedraw c1"></div>
    <div class="cubedraw c2"></div>
    <div class="cubedraw c3"></div>
    <div class="cubedraw c4"></div>
    <div class="cubedraw c5"></div>
</div>


I found a way to make it with less code, and more particular with one less inner division. I also more liked the cube to be more tilted backwards. This is the style and markup for my version:


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
<style type="text/css">
#cube {
    height6.5em;
    width6em;
    floatleft;
}
#cube div {
    width0;
    height0;
    border-stylesolid;
    overflowhidden;
}
#cube .c1 {
    border-colorwhite white blue white;
    border-width0 3em 1.5em 3em;
}
#cube .c2 {
    border-colorblue lime blue red;
    border-width1.5em 3em 0 3em;
    height2em;
}
#cube .c3 {
    border-colorwhite red white white;
    border-width0 3em 1.5em 0;
    floatleft;
}
#cube .c4 {
    border-colorwhite white white lime;
    border-width0 0 1.5em 3em;
    floatleft;
}
</style>
<div id="cube">
    <div class="c1"></div>
    <div class="c2"></div>
    <div class="c3"></div>
    <div class="c4"></div>
</div>


Note that I use em's to make it scalable with the rest of the 'design' :)

Volgende: Having fun with IE - part 3: doctype switching 01-12
Volgende: Having fun with IE - part 2: CSS inheritance 29-11

Comments

There are no comments for this post


Comment form
(required)
(required, but will not be displayed)
(optional)

Please enter the characters you see in the image below: