Solved

Please critique my work!

Posted on 2012-03-31
8
189 Views
Last Modified: 2012-04-01
Greetings,

I've included the code for a "box test" I was given by someone to test my abilities and how I do things with regards to structure and style.  They sent me a .png (attached) and asked me to create it using HTML and CSS.  

Incidentally, while the png shows each box with a letter designation, I did not include that figuring it was beside the point of the exercise i.e. they wanted to see how I deal with creating a table-less layout.  Perhaps that was a mistake in judgement?

I would ask any experts to inspect my work and critique what I've done.  Please be specific about where I could have done something perhaps better and I also want to know if I did something that was a no-no or even egregiously wrong by today's standards.

Tell me the truth but, be nice! :)

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>Box Test</title>
		<meta name="description" content="Box Test" />
		<style>
			#wrapper {
				width: 900px;
				height: auto;
			}
			#boxA, #two_box {
				border: 1px solid #000;
			}
			
			#boxB, #boxC {
				border-bottom: 1px solid #000;
			}
			
			#boxA, #two_box {
				width: 450px;
			}
			
			#boxA, #boxD, #two_box {
				height: 300px;
			}
			
			#boxA {
				background: #f4cccc;
			}
			#boxB {
				background: #b6d7a8;
				height: 150px;
			}
			#boxC {
				background: #cfe2f3;
				height: 149px;
			}
			#boxD {
				background: #ffe599;
				border: solid #000;
				border-width: 0 1px 1px 1px;
			}
			#two_box {
				float: right;
				margin-top: -302px;
			}
		</style>
	</head>
	<body>
		<div>
			<header>
				<h1>Box Test</h1>
			</header>
			<div id="wrapper">
				<div id="boxA"></div>
				<div id="two_box">
					<div id="boxB"></div>
					<div id="boxC"></div>
				</div>
				<div id="boxD"></div>
			</div>
			<footer></footer>
		</div>
	</body>
</html>

Open in new window


thanks,
0
Comment
Question by:max7
8 Comments
 
LVL 1

Author Comment

by:max7
ID: 37791581
sorry, it seems I did not attach the original png for this.
boxTest.png
0
 
LVL 20

Expert Comment

by:n2fc
ID: 37791632
Good job!  Neatly organized and very readable code...
0
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 300 total points
ID: 37791887
I would get rid of the unused <footer> tag. Unless it's necessary, which I doubt.
It looks like you friend wants the box and the text centered.
Also, I changed the width of the two smaller boxes to 50% instead of 450px.

Here's the modified code I came up with:

<!DOCTYPE html>
<html lang="en">
      <head>
            <meta charset="utf-8" />
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
            <title>Box Test</title>
            <meta name="description" content="Box Test" />
            <style>
                  #outer {
                        width: 100%;
                  }
                  #wrapper {
                        width: 90%;
                        height: auto;
                        margin: 0px auto;
                  }
                  #boxA, #two_box {
                        border: 1px solid #000;
                  }
                  
                  #boxB, #boxC {
                        border-bottom: 1px solid #000;
                  }
                  
                  #boxA, #two_box {
                        width: 50%;
                  }
                  
                  #boxA, #boxD, #two_box {
                        height: 300px;
                  }
                  
                  #boxA {
                        background: #f4cccc;
                  }
                  #boxB {
                        background: #b6d7a8;
                        height: 150px;
                  }
                  #boxC {
                        background: #cfe2f3;
                        height: 149px;
                  }
                  #boxD {
                        background: #ffe599;
                        border: solid #000;
                        border-width: 0 1px 1px 1px;
                  }
                  #two_box {
                        float: right;
                        margin-top: -302px;
                  }
                  #boxtest {
                        text-align: center;
                  }
            </style>
      </head>
      <body>
            <div>
                  <header>
                        <h1 id="boxtest">HTML/CSS Box Test</h1>
                  </header>
                  <div id="outer">
                        <div id="wrapper">
                              <div id="boxA"></div>
                              <div id="two_box">
                                    <div id="boxB"></div>
                                    <div id="boxC"></div>
                              </div>
                              <div id="boxD"></div>
                        </div>
                  </div>
            </div>
      </body>
</html>
0
 
LVL 1

Author Comment

by:max7
ID: 37791951
I would get rid of the unused <footer> tag. Unless it's necessary, which I doubt.

Yes, I noticed that as well.  Does it look terribly bad to have that hanging around unused?

It looks like you friend wants the box and the text centered.

Not sure what you mean by wanting the box centered.  Could you expand on that?

Regarding the text, are you indicating you think it was a mistake NOT to include it?

Also, I changed the width of the two smaller boxes to 50% instead of 450px.

Is there a particular advantage to using % for width instead of px?  Is it a poor choice to use pixel instead of % here?

Keeping the issues you mentioned in mind, overall, do you think the work here is decent?  Can you give it a grade e.g. A through F?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 23

Assisted Solution

by:Eirman
Eirman earned 200 total points
ID: 37792027
> Is there a particular advantage to using % for width instead of px?

% is better becase it displays much better/consistently on different monitor sizes, aspect ratios and resolutions.
0
 
LVL 1

Author Comment

by:max7
ID: 37792067
Not sure what you mean by wanting the box centered.  Could you expand on that?

ok, I feel foolish.  I wasn't carefully reviewing your code changes but I now see the outer div and how you centered the wrapper div within it. Doh!

% is better becase it displays much better/consistently on different monitor sizes, aspect ratios and resolutions.

Excellent, thanks for that.

Still hoping for an over-all assessment of this work.
0
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 37792196
Grade A- because of the centering and sizing. Plus I think you should put in the letters A B C D like the image has.
0
 
LVL 1

Author Closing Comment

by:max7
ID: 37793151
Thanks very much for the feedback, greatly appreciate it!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Button Css BootStrap 2 36
Hyper V cluster 2 34
help squeezing some space out in this site 9 19
How to count in a table in php 22 19
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now