www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > CSS

    CSS Discussion and technical support relating to Cascading Style Sheets.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-21-2009, 07:10 AM
    DaSilva DaSilva is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 29
    Question Text - Image - Text

    I want to realize the following:

    This is | IMAGE | This is
    a text | IMAGE | a text
    on the | IMAGE | on the
    left side | IMAGE | right side

    How can I do this? I have tried it with the following CSS but it doesn't work:

    Code:
    #content #contentleft {
    	width: 375;
    	float: left;
    }
    #content #contentright {
    	width: 375;
    	float: right;
    	text-align: left;
    }
    #content img.center {
    	float: center;
    	margin: 0 0 8px 8px;
    }
    Thanks in advance.
    Reply With Quote
      #2  
    Old 11-21-2009, 10:07 AM
    Fang's Avatar
    Fang Fang is offline
    Resistance is futile
     
    Join Date: Apr 2003
    Location: Netherlands
    Posts: 18,435
    That is normal layout
    Code:
    <p>This is <img> This is</p>
    There must be more specific requirements.
    __________________
    At least 98% of internet users' DNA is identical to that of chimpanzees
    Reply With Quote
      #3  
    Old 11-22-2009, 01:33 AM
    DaSilva DaSilva is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 29
    Question

    No, the text on the left side must be independed from the text on the right side. It should be two columns with an image between them exactly like in the picture (attachment).
    Thanks
    Attached Images
    File Type: png 2textcolumnsimg.png (87.6 KB, 29 views)
    Reply With Quote
      #4  
    Old 11-22-2009, 07:49 AM
    opifex's Avatar
    opifex opifex is offline
    ignorance is curable...
     
    Join Date: Sep 2008
    Location: Mexico
    Posts: 784
    The example in this thread is the reverse... image - text - image.
    You can easily adapt it to what you want... inside one paragraph.
    Quote:
    Originally Posted by opifex View Post
    <span> is a very useful and versatile element!
    oh.... "float:center"??? ...none, left or right are your options.
    __________________
    ...but stupidity is terminal.

    Last edited by opifex; 11-22-2009 at 07:56 AM.
    Reply With Quote
      #5  
    Old 11-22-2009, 10:41 AM
    Fang's Avatar
    Fang Fang is offline
    Resistance is futile
     
    Join Date: Apr 2003
    Location: Netherlands
    Posts: 18,435
    http://www.alistapart.com/d/crosscolumn/example4.html
    __________________
    At least 98% of internet users' DNA is identical to that of chimpanzees
    Reply With Quote
      #6  
    Old 11-23-2009, 03:35 AM
    DaSilva DaSilva is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 29
    Arrow

    Thanks, but it seems to be to complicated because I don't want to set the line break for the image manually. Isn't it possible without extra classes?
    I now have used http://www.basictips.com/text-betwee...t-tables.shtml and switched the text with the image but then the image has its own column and the text doesn't wrap completely around it...
    Reply With Quote
      #7  
    Old 11-23-2009, 04:46 AM
    Fang's Avatar
    Fang Fang is offline
    Resistance is futile
     
    Join Date: Apr 2003
    Location: Netherlands
    Posts: 18,435
    There is no simple solution to this layout. When css3 becomes mainstream it should become easier.
    __________________
    At least 98% of internet users' DNA is identical to that of chimpanzees
    Reply With Quote
      #8  
    Old 11-23-2009, 11:02 PM
    DaSilva DaSilva is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 29
    Question

    I have the problem that Firefox displays everything correct but Internet Explorer or Google Chrome don't. You can try it by yourself on http://www.reisenachoz.de/v2/about.php .
    The CSS looks like this:
    Code:
    .floatleft {
      float: left;
      margin-right: 5px;
      width: 353px;
    }
    .floatright {
      float: right;
      margin-left: 5px;
      width: 353px;
    }
    p {
      margin: 0;
      padding: 0.4em 0;
      color: #FFFFFF;
      line-height: 1.4em;
      text-align: justify;
    }
    The important part looks like this:

    HTML Code:
            <p> <span class="floatleft">This is the text on the left side.
                </span>
                <img src="images/about.png">
                <span class="floatright">This is the text on the right side.
                </span>
            </p>
    As I said before I have used this tutorial.
    Reply With Quote
      #9  
    Old 11-24-2009, 12:41 AM
    opifex's Avatar
    opifex opifex is offline
    ignorance is curable...
     
    Join Date: Sep 2008
    Location: Mexico
    Posts: 784
    clear the floats.... check the referenced post for the example.
    HTML Code:
    clear:both;
    It's sometimes helpful to load the two floated elements in order...
    HTML Code:
    <p> 
        <span class="floatleft">This is the text on the left side. </span>
        <span class="floatright">This is the text on the right side. </span>
        <img src="images/about.png" alt="alt text"/>
    </p>
    Since you are using xhtml, remember to close your image tag.
    __________________
    ...but stupidity is terminal.

    Last edited by opifex; 11-24-2009 at 12:56 AM.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:13 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.