Need help with page layout

Discussion in 'HTML & Website Design' started by akshaykalia, Nov 1, 2010.

  1. #1
    Hi,
    I have a page, made is ASP .NET, in which all contents are dynamically obtained from database(DB).
    It has pic on right, whose address is stored in DB.and in place of pic, i display ad if no image addrss is there.
    i am doing it with help of ASP:panel. Image in panel 1 and ad code in panel 2. If there is image, i show panel 1 and hide panel 2. else Vice versa.
    Now i am having trouble with layout of page.
    I want the text to wrap around the image. After the height of image or ad,which i have set same, the text should occupy all available space below the image too.

    I am pasting the code snippet below :

    <div>

    <asp:Label ID="Author" runat="server" Text="Label"></asp:Label>
    <br />
    <asp:Label ID="Timestamp" runat="server" Text="Label"></asp:Label>
    <br />


    <asp:panel ID="Panel1" runat="server">

    //Ad code here

    </asp:panel>

    <asp:panel ID="Panel2" runat="server">
    <asp:Image ID="Image1" Width="320px" Height="268px" ImageUrl="<%=pic_url %>" runat="server" />
    </asp:panel>


    <%=body %> // retrives the body of the article from the database
    </div>
     
    akshaykalia, Nov 1, 2010 IP
  2. daljit

    daljit Well-Known Member

    Messages:
    312
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #2
    can you send the url of site......
     
    daljit, Nov 1, 2010 IP
  3. Dusanm

    Dusanm Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I also wanted to ask for url of the site...
     
    Dusanm, Nov 1, 2010 IP
  4. akshaykalia

    akshaykalia Member

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #4
    akshaykalia, Nov 2, 2010 IP
  5. akshaykalia

    akshaykalia Member

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #5
    also the content is just random..
    i just copied pasted random stuff into db to check the layout :)
     
    akshaykalia, Nov 2, 2010 IP
  6. Dusanm

    Dusanm Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    For the element around the picture remove all css(margin-left:600px;margin-right:10px;padding:10px;) and put just float:right;
    and for div where text is you don't need to put anything, text will just wrap around image. If you want image to have some margin add margin-left:XXX;

    I think this will help...
     
    Dusanm, Nov 2, 2010 IP
  7. akshaykalia

    akshaykalia Member

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #7
    aahhh..
    Thanks a lot..
    Also can you please give me another advice.
    here all the text appears as one block. but from where i copied it, it had paragraphs and line breaks.
    So when we store it in db , does we lose all formatting ?
    i tried putting the content in <pre> tag but it too didnt help
     
    akshaykalia, Nov 2, 2010 IP
  8. Dusanm

    Dusanm Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Try to implement some sort of WYSIWYG editor. I see that text is in one big DIV. Maybe to put <p> tag instead of that div, but i think that that is not so great solution... Try to implement WYSIWYG editor in textbox where you paste text...
     
    Dusanm, Nov 2, 2010 IP