Jump to content

[SOLVED] A question from a css beginner


proud

Recommended Posts

 

I want to design 2 seperate content boxes in one page but this code doesnt generate but only one content box so what code is missing or what is supposed to be corrected?

 

 

<style type="text/css">
<!--

#contentbox {
  background: #E5E5E5;
  padding: 5px;
  width: 500px;
  height: 340px;
  overflow: auto; }
    
-->
</style>

   echo "<div id=\"contentbox\">\n";
   echo "hello";
   echo "</div>\n";

   echo "<div id=\"contentbox\">\n";
   echo "hello";
   echo "</div>\n";

Link to comment
https://forums.phpfreaks.com/topic/40281-solved-a-question-from-a-css-beginner/
Share on other sites

you should not have 2 elements with the same id in one page of html...

 

use class instead.

 

<style type="text/css">
<!--

.contentbox {
  background: #E5E5E5;
  padding: 5px;
  width: 500px;
  height: 340px;
  overflow: auto; }
    
-->
</style>

   echo "<div class=\"contentbox\">\n";
   echo "hello";
   echo "</div>\n";

   echo "<div class=\"contentbox\">\n";
   echo "hello";
   echo "</div>\n";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.