www.webdeveloper.com
Results 1 to 7 of 7

Thread: Text caption beneath image

  1. #1
    Join Date
    Jun 2014
    Posts
    21

    Text caption beneath image

    Hi, I'm very new to web design and I wanted to make a row of images with one word captions beneath them.

    However what happens is that the images displace the text.

    http://imgur.com/XSv3kct

    My CSS is:

    Code:
    /********************
    Focuses
    ********************/
    
    #focuses{
    
    	white-space: nowrap;
    	
    
    }
    
    #focuses img{
    	display: inline-block; 
    	float: left; 
    	margin-right: 5px;
    }
    
    #focuses p {
    	
    	background-color: #e5e5e5;
    
    }

  2. #2
    Join Date
    Aug 2014
    Location
    Delhi
    Posts
    1
    That's right css coding given by you.

  3. #3
    Join Date
    Jun 2014
    Posts
    21
    Anyone help?

  4. #4
    Join Date
    Oct 2013
    Posts
    517
    Might help if you posted some HTML.

  5. #5
    Join Date
    Jul 2014
    Location
    Dubai, United Arab Emirates
    Posts
    15
    You didn't posted html, you need to create div for each image with text, for example

    <div>
    <img src=""/>
    <p>Text here</p>
    </div>

  6. #6
    Join Date
    Jun 2014
    Posts
    21
    <div id="focuses">

    <h2>Our Focuses</h2>

    <div>
    <img src ="img/communication.jpg">
    <p>Communication</p>

    </div>

    <div>
    <img src ="img/security.jpg">
    <p>Security</p>
    </div>

    <div>
    <img src ="img/management.jpg">
    <p>Management</p>
    </div>


    </div>

  7. #7
    Join Date
    Oct 2013
    Posts
    517
    Not a whole lot of help dude. I was really hoping you'd post the code between the <body> tags or give a link. But here's a WAG: you are using id="focuses" (and maybe other IDs) more than once on that page. You can only use an ID once per page. That's the rules. Want to use something again? Use Classes:

    HTML Code:
    <div class="focuses">
    your other code
    </div>
    CSS:
    Code:
    .focuses{
    
    	white-space: nowrap;
    	
    
    }
    
    .focuses img{
    	display: inline-block; 
    	float: left; 
    	margin-right: 5px;
    }
    
    .focuses p {
    	
    	background-color: #e5e5e5;
    
    }
    Last edited by Kevin2; 08-14-2014 at 02:52 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles