473,388 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to create side-by-side boxes inside another box?

19
Hello,

I want to create three side-by-side boxes inside a much larger box. I have this code:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <link rel="stylesheet" type="text/css" href="mystyle.css" />
  4. </head>
  5.  
  6. <body>
  7. <div style="width:100%; ">
  8.   <div id ="wrapper" >
  9.     <p class="headerStyle" > Online Movie Database </p>
  10.   </div>
  11.  
  12.   <div style="background-color:black;height:800px;width:20%;float:left;  ">
  13.   </br>
  14.  
  15.   </div>
  16.  
  17.   </div>
  18.  
  19.  
  20.   <div style="background-color:#E6E6E6;height:800px;width:60%; float:left;   ">
  21.  
  22.    Movie Recommendations
  23.    <div class ="textBox2">
  24.  
  25.     <div class ="textBox" style="float:left;">
  26.     </div> 
  27.      <div class ="textBox" style="float:left;">
  28.     </div> 
  29.     <div class ="textBox" style="float:right;  ">
  30.     </div>
  31.  
  32.  
  33.     </div>
  34.  
  35.   </div>
My CSS file is:

Expand|Select|Wrap|Line Numbers
  1. h1
  2. {
  3.  
  4. text-align: center;
  5. font: italic bold 350% 'Times New Roman';
  6. color: olive;
  7. }
  8.  
  9. .enter
  10. {
  11.  
  12. height:50px;
  13. width:1100px;
  14. }
  15.  
  16. .header
  17. {
  18. background-color:#610B0B;
  19. width:1350px;
  20. height:50px;
  21. }
  22.  
  23. .headerStyle
  24. {
  25. font-size:40px;
  26. font-family: Monotype Corsiva;
  27. text-align: center;
  28. font-weight:bold;
  29. font-weight:italic;
  30. color:silver; 
  31. padding-top:25px;
  32. padding-bottom:25px;
  33. padding-right:50px;
  34. padding-left:50px;
  35. border:2px solid gray;
  36.  
  37. }
  38. #wrapper
  39. {
  40. width:100%; 
  41. height:100px; 
  42. background-color:yellow;
  43. margin:0 auto;
  44. background-repeat:repeat-x;
  45. background-image:url('heading-tube-blue-bkg.jpg');
  46.  
  47. }
  48.  
  49. .textBox
  50. {
  51. background:color:black;
  52. width:220px;
  53. height:200px;
  54. padding:5px;
  55. border:1px solid gray;
  56. margin:15px;
  57.  
  58. }
  59.  
  60. .textBox2
  61. {
  62. width:780px;
  63. height:280px;
  64. padding:5px;
  65. border:0.5px solid gray;
  66. margin:5px;
  67.  
  68.  
  69. }
  70.  
  71. .SearchBox
  72. {
  73. height:25px;
  74. }
The code is not putting the third box correctly inside. Could anyone please help?
Apr 19 '11 #1

✓ answered by JKing

The boxes are too large to fit in the space.

The true width of the box will be the width + padding + margin. So the effective width of your boxes is 220px + 10px + 30px = 260px.

Tweak your margin and padding and it should be fine.

2 6501
JKing
1,206 Expert 1GB
The boxes are too large to fit in the space.

The true width of the box will be the width + padding + margin. So the effective width of your boxes is 220px + 10px + 30px = 260px.

Tweak your margin and padding and it should be fine.
Apr 19 '11 #2
kino
19
Thanks a lot, I changed the pixels and its working now!
Apr 19 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Rajesh N Thipse | last post by:
Hi, Files can be created using _creat. Similarly, is there a function to create a directory? ~Rajesh
4
by: Alex Page | last post by:
This is probably really basic, but I can't seem to get it to work. I'm trying to create an enumerated type, using the following code: CREATE FUNCTION enum_gender_in (cstring) RETURNS enum_gender...
15
by: Brian Rogers | last post by:
Hello everyone, I apologize for the cross and re-post, but I am still searching for an answer. Why can C++ can create this object, but C# can't? I am trying to create an instance of the...
9
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
4
by: Joe HM | last post by:
Hello - I have a Base Class where I want a New() implemented that can be called from the outside. This New() should create an instance of the appropriate cDerivedX Class ... The following...
6
by: Philip Wagenaar | last post by:
What is the best way to create a local user on the machine with administrator rights? I have problems with my code on machines that have password policy. The problem is that when the user is...
37
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
2
by: masri999 | last post by:
I have a requirement in SQL 2005 in Development database 1. Schema dbo owns all objects (tables,views,SPs,UDFs etc) . 2. Only DBA's ( who are database owners ) can create, alter tables ....
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
4
by: JohnnyDeep | last post by:
I am trying to create a store proc that contain a create index with the cluster option and I receive DB21034E The command was processed as an SQL statement because it was not a valid Command...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.