473,394 Members | 1,944 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,394 software developers and data experts.

aligning text exactly beneath images.I have 2 rows of images, 3 images in each row

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5. <title>Page Title</title>
  6. <link href="style3test.css" rel="stylesheet" type="text/css"/>
  7. </head>
  8. <body>
  9.  
  10. <div id="wrapper">
  11. <header>
  12. <div id="logo" >
  13. <h2> Company <br> Logo</h2>
  14. </div>
  15.  
  16. <div id="contactbox">
  17. <div id="contacttext">
  18. <p>02&nbsp;9988&nbsp;7766&nbsp;(p)<br/>
  19. info@company.com&nbsp;(e)<br/>
  20. www.company.com&nbsp;(w)</p>
  21. </div>
  22. </div>
  23.  
  24. </header>
  25. <section>
  26.  
  27. <div id ="right">
  28.     <div id="gallery">
  29.     <h3>Gallery</h3>
  30.     </div>
  31.  
  32.  
  33. <div class = "item">
  34. <img src="http://bytes.com/images/personalImage.jpg" style ="float: left; width: 25%%; margin-left: 5%;" 
  35.  
  36. alt="Gallerylayout"/>
  37. <span class = "caption">Text below image</span>
  38. </div>
  39.  
  40. <div class = "item">
  41. <img src="http://bytes.com/images/personalImage.jpg" style ="float: left; width: 25%; margin-left: 5%;" 
  42.  
  43. alt="Gallerylayout"/>
  44.  
  45. </div>
  46.  
  47. <div class = "item">
  48. <img src="http://bytes.com/images/personalImage.jpg" style ="float: left; width: 25%; margin-left: 5%;" 
  49.  
  50. alt="Gallerylayout"/>
  51.  
  52. </div>
  53.  
  54. <div class = "item">
  55. <img src="http://bytes.com/images/personalImage.jpg" style ="float: left; width: 25%; margin-left: 5%;" 
  56.  
  57. alt="Gallerylayout"/>
  58.  
  59. </div>
  60.  
  61. <div class = "item">
  62. <img src="http://bytes.com/images/personalImage.jpg" style ="float: left; width: 25%; margin-left: 5%;" 
  63.  
  64. alt="Gallerylayout"/>
  65.  
  66. </div>
  67.  
  68. <div class = "item">
  69. <img src="http://bytes.com/images/personalImage.jpg" style ="float: left; width: 25%; margin-left: 5%;" 
  70.  
  71. alt="Gallerylayout"/>
  72.  
  73. </div>
  74.  
  75.  
  76. </div>
  77.  
  78. <div id="left">
  79. <div id="nav">
  80. <h3>Navigation</h3>
  81. </div>
  82. <div id ="text">
  83. <ul style="list-style-type: none;">
  84. <li>&gt;Home</li>
  85. <li>&gt;About&nbsp;Us</li>
  86. <li>&gt;Gallery</li>
  87. <li>&gt;Contact&nbsp;Us</li>
  88. </ul>
  89. </div>
  90. </div>
  91.  
  92. </section>
  93. <footer>
  94. <p>Copyright&nbsp;2012&nbsp;Company&nbsp;Name</p>
  95. </footer>
  96. </div>
  97.  
  98. </body>
  99. </html>
  100.  
Expand|Select|Wrap|Line Numbers
  1. /*@ charset="UTF-8";*/
  2.  
  3. body{
  4. background-color:grey;
  5. font-family: ;
  6.     margin: 0;
  7. }
  8.  
  9. #wrapper
  10. {
  11. background-color: #fff;
  12. margin-left:auto;
  13. margin-right:auto;
  14.  
  15. width:900px;
  16. padding:10px;
  17. }
  18.  
  19. header
  20. {
  21.  
  22. background-color: yellow;
  23.     min-height: 180px;
  24.     padding-top: 10px;
  25.     padding-left: 10px;
  26.     padding-right:10px;
  27.     padding-bottom: 10px;
  28.     margin-bottom:10px;
  29. }
  30. #logo
  31. {
  32. background-color:grey;
  33. color:black;
  34. font-size: 1.9em;
  35. font-family: Verdina;
  36. float:left;
  37. text-align: center;
  38. width: 300px;
  39. height:180px;
  40. margin:auto;
  41.  
  42.  
  43. }
  44.  
  45.  
  46.  
  47. #contactbox
  48. {
  49. background-color:grey;
  50. float:right;
  51. width: 300px;
  52. height:180px;
  53. padding-right: 3%;
  54. }
  55.  
  56. #contacttext
  57. {
  58.  
  59. font-size: 1.3em;
  60. color:black;
  61. text-align:right;
  62. font-weight: bold;
  63. padding-top: 20px;
  64. line-height: 150%;
  65. }
  66.  
  67.  
  68.  
  69. #right{
  70.  
  71.     background-color: green;
  72.     margin-bottom:1%;
  73.     margin-top: 1%; 
  74.     width:580px;
  75.     height:600px;
  76.     float:right;
  77.     display: inline-block;
  78. }
  79.  
  80.  
  81.  
  82. #gallery{
  83.     text-indent:20px;
  84.     font-size: 18px;
  85. }
  86.  
  87. .item
  88. {
  89. float:left;
  90.  
  91.  
  92. }
  93.  
  94.  
  95. #caption{
  96.  
  97.     display: block;
  98.     text-align: left;a
  99.  
  100. }
  101.  
  102.  
  103.  
  104.  
  105. #left{
  106.     background-color: blue;
  107.     margin-bottom:2%;
  108.     margin-top:1%;
  109.     width:300px;
  110.     height:600px;
  111.     float:left;
  112.  
  113.     }
  114.  
  115. #text{
  116.     text-indent: -20px;
  117.     color: white;
  118.     line-height: 200%;
  119. }
  120.  
  121. #nav{
  122.  
  123. text-indent: 20px;
  124. font-size: 18px;
  125. }
  126.  
  127. footer
  128. {
  129. background-color: pink;
  130.     padding-top: 1%;
  131.     padding-right: 2%;
  132.     padding-left: 2%;
  133.     padding-bottom: 2%;
  134.     height:40px;
  135.     clear:both;
  136.                  text-align:center;
  137.     }

please help me thanks
Aug 4 '15 #1
1 7867
Use the
Expand|Select|Wrap|Line Numbers
  1. p {
  2.      position:relative; 
  3.      left:npx;
  4.      top:npx; 
  5.      bottom:npx;
  6.      right:npx;
  7. }
on the css."n" refers to the number you input to position it right.But you should know that they work vice versa.For example left takes it to the right.And one last tip,Don't post all your codes when asking questions.
Nov 19 '15 #2

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

Similar topics

7
by: Henrik Berg Nielsen | last post by:
Hi group! I need to extract some text (well numbers actually) from a bunch of similarly looking .png images. After extraction the numbers will be fed to a Python script for further processing....
6
by: Steven Bethard | last post by:
I have a string with a bunch of whitespace in it, and a series of chunks of that string whose indices I need to find. However, the chunks have been whitespace-normalized, so that multiple spaces...
16
by: C.W | last post by:
I have a top box element that houses the web site title: #top_section { height: 20px; padding: 10px; text-align: left; background: navy; color: white; }
0
by: styler | last post by:
I am having difficulty with the page located here: http://tinyurl.com/2zwa9 I am creating a number of image sets (some left-, some right-aligned; an example of the right-aligned is shown the...
20
by: Roberto | last post by:
Hallo, I'm building a page that wants to respect XHTML 1.0 strict and CSS2 specifics. In this page I have to present thumbnails arranged to cover the entire width of the window, but there are...
5
by: Amir | last post by:
When prefetching images, why do I need the "if (document.images)" statement? if (document.images) { pic1on= new Image(300,300); pic1on.src="pic1.gif"; pic2on= new Image();...
2
by: Larry Rekow | last post by:
A friend's unix application produces various reports daily as flat text files. I link these files as tables in an Access (2000) database. After linking, all of these reports begin with a...
1
by: cazconv2007 | last post by:
Hi under my floating images i cant get text under them why not? it goes to the side <!--navigation menu--> <div id = "mainnavigation"> <a href = "home.html">Home</a> |<a href = ...
10
unstoppablekatia
by: unstoppablekatia | last post by:
I have a website that has images on it, and underneath the images are text. My only option of aligning the images and text separate from each other, is to do <div align="right">, <center>, or <div...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.