CSS question/problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Machete_
    WINNING!
    • Oct 2002
    • 14579

    #1

    CSS question/problem

    Ok - let me try and explain the problem

    I have a list where I want to add a few pictures, like this:

    <li><image 01><image 02><image 03><image 04></li>


    I want the image to be sorounded by a border and a caption text below.


    I have it on a blog, but i suck at CSS and my programmer went on vacation without telling me.

    I was hoping for a solution where I add the style to the global CSS file and could write something like
    <li><div class="imgbox><image 01>some text</div> <div class="imgbox><image 02>some text</div> <div class="imgbox><image 03>some text</div> </li>

    But if I do that, it adds a linebreak.. what am i doing wrong here?
  • Machete_
    WINNING!
    • Oct 2002
    • 14579

    #2
    Figured it out myself

    made a style like this

    PHP Code:
     div.box 
    {ha 
    width:320px;
    padding:5px;
    border:1px solid #CCC;
    margin:5px;
    float:left;
    text-align:center;
    background-color: #f0f0f0;
    } 
    

    and added this to the doc

    PHP Code:
    <div class="box"> <img src="image.jpg" alt="alt img text" width="300" height="200"><br>text below image</div> 
    

    Comment

    • Killswitch - BANNED FOR LIFE

      #3
      jQuery ftw!

      <li><img src="image.jpg" alt="your text here" /></li>

      Using jQuery that will do exactly what you need :D

      Comment

      • webboy21
        Confirmed User
        • Nov 2004
        • 573

        #4
        you didn't need the <br>....you could have used div.box img and then display: block;

        also no float needed, actually not sure why you are adding the float
        Available for: CSS | XHTML | PHP | MySQL | Webdesign

        Comment

        • webboy21
          Confirmed User
          • Nov 2004
          • 573

          #5
          oh wait, you wanted them next to eachother...never mind...that's why you need the float :P
          Available for: CSS | XHTML | PHP | MySQL | Webdesign

          Comment

          • Machete_
            WINNING!
            • Oct 2002
            • 14579

            #6
            Aholes

            I spend 3 hours going through CSS tutorials and cursing why it wouldent work


            I will look at both the solutions you suggested just to make sure I do the smartest thing from the start..

            thanks

            Comment

            • webboy21
              Confirmed User
              • Nov 2004
              • 573

              #7
              sorry kris, if I had seen this earlier I would have said so earlier
              Available for: CSS | XHTML | PHP | MySQL | Webdesign

              Comment

              • Machete_
                WINNING!
                • Oct 2002
                • 14579

                #8
                Originally posted by webboy21
                sorry kris, if I had seen this earlier I would have said so earlier
                No worries. all that matter is it got done and I learned something

                Comment

                • JeffCliff
                  Confirmed User
                  • Jul 2008
                  • 183

                  #9
                  Originally posted by KrisH
                  Ok - let me try and explain the problem

                  I have a list where I want to add a few pictures, like this:

                  <li><image 01><image 02><image 03><image 04></li>


                  I want the image to be sorounded by a border and a caption text below.


                  I have it on a blog, but i suck at CSS and my programmer went on vacation without telling me.

                  I was hoping for a solution where I add the style to the global CSS file and could write something like
                  <li><div class="imgbox><image 01>some text</div> <div class="imgbox><image 02>some text</div> <div class="imgbox><image 03>some text</div> </li>

                  But if I do that, it adds a linebreak.. what am i doing wrong here?
                  Wait, your programmer just gets up and goes on vacation when he pleases... Can I work for you?
                  Private Partners Network - Up to 50%; FULL range of products; Weekly payouts - always on time! PM me for more details!

                  Comment

                  • tonyparra
                    Confirmed User
                    • Jul 2008
                    • 4568

                    #10
                    I need to do something similar was jus goona post on it lemme try what you did...

                    High Performance Vps $10 Linode
                    Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                    Comment

                    • tonyparra
                      Confirmed User
                      • Jul 2008
                      • 4568

                      #11
                      Actually wrong i want the text to align at the top to the right of the image is this possible in a list?
                      Last edited by tonyparra; 07-29-2009, 09:18 AM. Reason: missed some words

                      High Performance Vps $10 Linode
                      Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                      Comment

                      • tonyparra
                        Confirmed User
                        • Jul 2008
                        • 4568

                        #12
                        Heres and example of what im saying:

                        see how the text is under and at bottom of pictures? how can i align it to the top so that it looks better? Im using a list.
                        Last edited by tonyparra; 07-29-2009, 09:31 AM. Reason: left out image

                        High Performance Vps $10 Linode
                        Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                        Comment

                        • Machete_
                          WINNING!
                          • Oct 2002
                          • 14579

                          #13
                          Originally posted by tonyparra
                          Heres and example of what im saying:

                          see how the text is under and at bottom of pictures? how can i align it to the top so that it looks better? Im using a list.
                          '

                          you are related to teencat, I would rather fuck bill o'reilly bareback in the middle the vatican city, before I would provide you with as much as one nano-inch of helpfull advice.

                          Was that clear enough for you?

                          Comment

                          • Machete_
                            WINNING!
                            • Oct 2002
                            • 14579

                            #14
                            Originally posted by JeffCliff
                            Wait, your programmer just gets up and goes on vacation when he pleases... Can I work for you?
                            he is not "my" programmer, its just a guy I use when I need simple stuff done

                            Comment

                            • tonyparra
                              Confirmed User
                              • Jul 2008
                              • 4568

                              #15
                              Originally posted by KrisH
                              '

                              you are related to teencat, I would rather fuck bill o'reilly bareback in the middle the vatican city, before I would provide you with as much as one nano-inch of helpfull advice.

                              Was that clear enough for you?
                              Why do you want to fuck bill o'reilly man?

                              High Performance Vps $10 Linode
                              Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot

                              Comment

                              Working...