LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-05-2013, 11:55 PM   #1
shams
Member
 
Registered: Jan 2004
Posts: 535

Rep: Reputation: 30
Right sidebar creation problem in html web page?


I want to create a web page with content and two sidebars but the right sidebar going to the left side as well ovarlap the left sidebar, these are html codes:
Quote:
#LeftBar {
position: absolute;
background-color:#FFD700;
height:103%;
width:18.5%;
top: -1%;
float:left;

}
#RightBar {
position: absolute;
background-color:#FFD700;
height:103%;
width:15%;
top: -1%;
float:right;
}

#wrapper {
width:800px;
}

#container {
width: 800px;
height: 100px;
background-color:#EEEEEE;

position:absolute;
left: 23%;
right: 20%;
top: 5%;
height: 103%;
margin-left: -50px;
margin-top: -50px;
float: left;
}
Quote:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test web page</title>
<meta name="generator" content="Bluefish 2.2.3" >
<meta name="author" content="root" >
<meta name="date" content="2013-03-05T22:46:22+0430" >
<meta name="copyright" content="">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="expires" content="0">
<meta >
<link href="test.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="LeftBar" >where are u left bar</div>
<div id="RightBar">where are u right bar</div>
<div id="wrapper">
<div id="container">
<br /><br />
Contents goes here.
</div>
</div>
</body>
</html>

Last edited by shams; 03-06-2013 at 02:00 AM.
 
Old 03-06-2013, 03:42 AM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
shams,

I couldn't quite see what your reasoning was in your approach to the CSS.

Maybe we could start with the following, and work from there.

The contents of test.css after I finished editing it to produce something like what I thought you might have wanted:

Code:
#wrapper
{
    width:  800px ;
    height:  100px ;

    margin:  0px ;
    border:  0px ;
    padding:  0px ;
}

#LeftBar
{
    background-color:  #FFD700 ;

    /*     height:  103% ; */
    height:  100px ;
    /*     width:  18.5% ; */
    width:  148px ;  /*  148px = 18.5% of 800px  */

    /*     top:  -1% ; */
    margin:  0px ;
    border:  0px ;
    padding:  0px ;
    position:  absolute ;
    /*     float:  left ; */
    left:  0px ;
}


#RightBar
{
    background-color:  #FFD700 ;

    /*     height:  103% ; */
    height:  100px ;
    /*     width:  15% ; */
    width:  120px ;  /*  120px = 15% of 800px  */

    /*     top:  -1% ; */
    margin:  0px ;
    border:  0px ;
    padding:  0px ;
    position:   absolute ;
    /*     float:  right ; */
    left:  680px ;
}


#container
{
    background-color:  #EEEEEE ;

    /*     height:  103% ; */
    /*     width:  800px ; */
    height:  100px ;
    /*     width:  67.5% ; */
    width:  532px ;

    margin:  0px ;
    border:  0px ;
    padding:  0px ;
    position:  absolute ;
    /*     float:  left ; */
    /*     left:  2% ; */
    /*     top:  5% ; */
    /*     margin-left:  -50px ; */
    /*     margin-top:  -50px ; */
    left:  148px ;  /*  148px = 18.5% of 800px  */
    /*     right:   15% ; */
}
In test.css I tried to supply some formatting, and group together, what I viewed as related lines. In what you originally had, I commented out things for which I didn't understand the purpose. I left your original CSS lines so we perhaps we could refer to them in a discussion.

The contents of test.html after I formatted it:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

    <head>
        <title>test web page</title>
        <meta name="generator" content="Bluefish 2.2.3" >
        <meta name="author" content="root" >
        <meta name="date" content="2013-03-05T22:46:22+0430" >
        <meta name="copyright" content="">
        <meta name="keywords" content="">
        <meta name="description" content="">
        <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8">
        <meta http-equiv="content-style-type" content="text/css">
        <meta http-equiv="expires" content="0">
        <meta >
        <link href="test.css" rel="stylesheet" type="text/css">
    </head>

    <body>
        <div id="wrapper">
            <div id="LeftBar" >where are u left bar</div>
            <div id="RightBar">where are u right bar</div>
            <div id="container">
                <br />
                <br />
                Contents goes here.
            </div>
        </div>
    </body>

</html>
I attached an image file of what the results looks like, when I opened test.html in various browsers I tested. If you would, perhaps you could please start with what I've provided, and guide us through the reasons you would change from that, in going towards what you originally posted.
Attached Thumbnails
Click image for larger version

Name:	right_sidebar_prob.png
Views:	13
Size:	10.1 KB
ID:	12009  
 
Old 03-06-2013, 09:05 AM   #3
shams
Member
 
Registered: Jan 2004
Posts: 535

Original Poster
Rep: Reputation: 30
Thanks rigor for the reply, i want the web page expand to the all screen and the content width should be 700px and the remaing of screen will divide into left and right sidebars or any other good layout will be recommend for the web page.

Last edited by shams; 03-06-2013 at 09:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
On the web browser and File>Save As>Web Page, HTML only. stf92 Linux - Newbie 4 12-18-2010 04:21 AM
Web Page Creation on Linux ciao303 Linux - Newbie 16 09-14-2010 11:16 PM
Text Books and Tutorials Online Regarding Web Page Creation Software? Novatian Linux - Software 4 06-05-2010 12:06 PM
How to execute a shell script from a simple html web page Shreerang Patwardhan Linux - Software 7 03-11-2010 11:12 AM
Which is the best Web page creation app for a newbie? Stevetgn Linux - Software 10 07-05-2004 11:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration