What Is HTML?

What is wrong with my HTML code?

  • I have a school assignment and I couldn't figure out how to make the last box (http://bildr.no/view/983838 ). I asked on here how to do it and I got an answer. But it doesn't seem to work when I run my code on IE. What is wrong with my code? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml… <html xmlns="http://www.w3.org/1999/xhtml"> <html> <title></title> <style type="text/css"> #diva{ width:200px; height: 200px; background-color: DimGrey; border: 10px solid black; margin-bottom: 20px;} #divb{ width: 60px; height: 60px; background-color: black; border: 80px solid DimGray; margin-bottom: 20px;} #divc{ width: 73px; height: 200px; background-color: #4A4A4A; border-left: 73px solid #151515; border-right: 73px solid #878787; margin-bottom: 20px;} #divd{ width: 60px: height:60 border-color: #505050 #6E6E6E #8C8C8C #323232;} background-color: #c8c8c8; border: 10px solid; </style <html> </body> <div id="diva"></div> <div id="divb"></div> <div id="divc"></div> <div id="divd"></div> </body> </html>

  • Answer:

    Try this for the bottom part of your file: #divd{ width: 73px; height: 73px; /* replaced colon after 60px with semicolon, added semicolon after height, changed from 60px to 73px */ border: 73px solid; /* moved border before border-color - need borders before you can change their colors */ border-color: #505050 #6E6E6E #8C8C8C #323232; background-color: #c8c8c8; } /* changed border from 10px to 73px, added right curly brace */ </style> <!-- added closing bracket for style tag --> <html> <body> <!-- removed slash from body tag --> <div id="diva"></div> <div id="divb"></div> <div id="divc"></div> <div id="divd"></div> </body> </html>

David at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

You have two open <html> elements but only one closing </html> tag. Your </style> closing tag is also missing a closing bracket (>). You also have a closed </body> tag where you should have an open <body> tag instead.

Nicole

To summarize the first 2 posts, here is your final answer: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml… <html xmlns="http://www.w3.org/1999/xhtml"> <html> <style type="text/css"> #diva { border:10px solid #000; width:200px; height:200px; background-color:gray; margin:10px; } #divb { width:80px; height:80px; background-color:#000; border:70px solid gray; margin:10px; } #divc { width:73px; height:200px; background-color:gray; margin:10px; border-left:73px solid #000; border-right:73px solid #ccc; } #divd { width:73px; height:73px; background-color:#ccc; margin:10px; border:73px solid; border-color:#858585 #9C9C9C #B5B5B5 #757575; } </style> <body> <div id="diva"></div> <div id="divb"></div> <div id="divc"></div> <div id="divd"></div> </body> </html> Works in IE, hope this helps :)

Christopher

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.