简体   繁体   English

html列样式和边框css

[英]html column styling and border css

what i have in the code: wrapper div outemost which in css i made to width of auto so all the inner divs have to align 我在代码中有什么:包装div最重要的是在css中,我将其设置为auto的宽度,因此所有内部div必须对齐

inside my container div which inside of wrapper container div contains both sidebars which should be same height. 在我的容器div中,包装容器div的内部包含两个相同高度的侧边栏。 Instead they don't do this and Im not sure why. 相反,他们不这样做,我不确定为什么。 Instead of having two sidebars I would like to keep the right sidebar and strect the content from the left sidebar from the left to the right sidebar. 与其保留两个侧边栏,不如我保留右侧边栏,并从左侧边栏将内容从左侧向右侧边条。

Another major problem is that the right sidebar keeps overflowing its text and when i tried overflow:hidden it just hid evrything outside of the sidebar div which isn't what I want 另一个主要问题是右侧边栏一直在溢出文本,当我尝试溢出时:隐藏它只是在边栏div之外隐藏了evrything,这不是我想要的

here is jsfiddle so you can better see it. 这是jsfiddle,因此您可以更好地看到它。 I want to stop overflowing on the right sidebar and when the left sidebar is width to touch the right sidebar then under the content of the leftsidebar is where i want the buttons becuase they go out the screen when I widen the width. 我想停止在右侧边栏上的溢出,并且当左侧边栏的宽度是触摸右侧边栏时,那么在左侧边栏的内容下方是我希望按钮的位置,因为当我加宽宽度时,它们会离开屏幕。

http://jsfiddle.net/b6bW4/ http://jsfiddle.net/b6bW4/

<!DOCTYPE html>
<html lang="en">
    <html>
        <title>Building Blocks to Html</title>
        <head>
            <SCRIPT language=JavaScript>
                var updated = document.lastModified document.write("Last modified: " + updated)
            </script>
            <script src="start.js"></script>
            <meta name="keywords" content="HTML, Hyper Text Markup Language, />
            <meta name="description" content="HTML in easy steps. Introductory tutorial for beginners." / >
            <meta name="author" content="Miguel Castaneda" />
            <meta charset="UTF-8">
            <meta name="robots" content="all, nofollow" />
            <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
            <META HTTP-EQUIV="Expires" CONTENT="-1">
        </head>
        <body>
            <div id="wrapper">
                <!--  wrapper holds everything should be auto  -->
                <div id="mod"></div>
                <!-- end of mod -->
                <center>
                    <a name="top"></center>
                    <center>
                        <a href="#bottom">Bottom</a>
                    </center>
                    <div id="mainmenu">
                        <ul>
                            <li>
                                <a href="index.html">Home</a>
                            </li>
                            <!-- 5 table spacing links//-->
                            <li>
                                <a href="html.html">HTML</a>
                            </li>
                            <li>
                                <a href="python.html">Python</a>
                            </li>
                            <li>
                                <a href="widgets.html">Widgets</a>
                            </li>
                            <li>
                                <a href="contact_us.html">Contact Us</a>
                            </li>
                        </ul>
                    </div>
                    <!-- end of mainmenu  -->
                    <div id="container">
                        //container holds content and sidebar
                        <div id="sidebar">
                            <p>HELLLLLLLLLLLEEEwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwMwwwwwwwwwwwwwwwwwwwwwwwwwEwwwwwwawawakdjadjlkajdlk;asmdksm.a</p>
                        </div>
                        <!-- end of sidebar -->
                        <div id="content">
                            <p >
                                <!-- browser picks first one in array if not in cpu then goes to 2nd font //-->
                                <tt>
                                    Programmer: Miguel Castaneda(iSten23)
                                    <br>
                                </br>
                                Head First HTML5 Programming
                                <br>
                            </br>
                            THIS SITE IS FOR EXPERIMENTAL PURPOSES, IS NOT INTENDED FOR COMMERCIAL PURPOSES.
                        </p>
                    </tt>
                </div>
                <!-- end of content -->
            </div>
            <!--  end of containeer-->
            <center>
                <a  href="#top" id="topl">Top</a>
                <div  id="leftrightB" >
                    <UL id="ul-list">
                        <li>
                            <a  id="rightB"href="basic5.html" class="addborder" >
                                <img    src="arrow1.png" height="40" width="40" alt="Link to next page">
                            </a>
                        </li>
                        <li>
                            <a  id="leftB"href="basic7.html" class="addborder">
                                <img    src="arrow.png" height="40" width="40" alt="Link to next page">
                            </a>
                        </li>
                    </ul>
                </div>
                <!--end of leftrightB  -->
                <div id="footermenu">
                    <ul>
                        <li>
                            <a href="index.html">Home</a>
                        </li>
                        <!-- 5 table spacing links//-->
                        <li>
                            <a href="html.html">HTML</a>
                        </li>
                        <li>
                            <a href="python.html">Python</a>
                        </li>
                        <li>
                            <a href="widgets.html">Widgets</a>
                        </li>
                        <li>
                            <a href="contact_us.html">Contact Us</a>
                        </li>
                    </ul>
                </div>
                <!-- END OF FOOTERMENU -->
                <a name="bottom"></div>
                <!--  END OF WRAPPER-->
            </body>
            <style>
                #ul-list li {
                }
                a:hover {
                    color: #00f000;
                    text-shadow: 0px 2px green;
                }
                .addborder:hover {
                    border: 1px solid #000000;
                }
                #sidebar {
                    position: absolute;
                    right: 0;
                    margin-top: 2px;
                    background-color: #8cc63f;
                    border-top: 1px solid #fff;
                    border-bottom: 1px solid #fff;
                    font-size: 10px;
                    line-height: 1;
                    padding: 0px 5px 0px 5px;
                    width: 10%;
                    height: 480px;
                    background-image: radial-gradient(hsla(0, 0%, 87%, 0.31) 9px, transparent 10px), repeating-radial-gradient(hsla(0, 0%, 87%, 0.31) 0, hsla(0, 0%, 87%, 0.31) 4px, transparent 5px, transparent 20px, hsla(0, 0%, 87%, 0.31) 21px, hsla(0, 0%, 87%, 0.31) 25px, transparent 26px, transparent 50px);
                    background-size: 30px 30px, 90px 90px;
                    background-position: 0 0;
                    <!-- //white-space: nowrap;
                    //overflow: hidden;
                    //word-wrap: break-word -->
                }
                #wrapper {
                    width: auto;
                }
                #content {
                    position: absolute;
                    left: 0;
                    background-color: #8cc63f;
                    border-top: 1px solid #fff;
                    border-bottom: 1px solid #fff;
                    font-size: 10px;
                    line-height: 1;
                    padding: 0px 5px 0px 5px;
                    width: 10%;
                    height: 480px;
                }
                <!-- img {
                    border-width: 1px;
                    border-color: Black;
                }
                --> .table {
                    display: table;
                    <!-- Allow the centering to work */ --> margin: 0 auto;
                }
                ul#ul-list {
                    min-width: 696px;
                    list-style: none;
                    padding-top: 20px;
                }
                ul#ul-list li {
                    display: inline;
                }
                #mainmenu {
                    width: auto;
                    height: 35px;
                    font-size: 16px;
                    font-family: Tahoma, Geneva, sans-serif;
                    font-weight: bold;
                    text-align: center;
                    text-shadow: 3px 2px 3px #333333;
                    background-color: #8AD9FF;
                    border-radius: 8px;
                    position: absolute;
                    top: 50px;
                    left: 0;
                    right: 0;
                    margin-left: 0;
                    margin-right: 0;
                }
                #mainmenu ul {
                    height: auto;
                    padding: 8px 0px;
                    margin: 0px;
                }
                #mainmenu li {
                    display: inline;
                    padding: 20px;
                }
                #mainmenu a {
                    text-decoration: none;
                    color: #00F;
                    padding: 8px 8px 8px 8px;
                }
                #mainmenu a:hover {
                    color: #F90;
                    background-color: #FFF;
                }
                #footermenu {
                    width: auto;
                    height: 35px;
                    font-size: 16px;
                    font-family: Tahoma, Geneva, sans-serif;
                    font-weight: bold;
                    text-align: center;
                    text-shadow: 3px 2px 3px #333333;
                    background-color: #52D7E5;
                    //main color of the menu border-radius: 8px;
                    position: absolute;
                    bottom: 0px;
                    left: 0;
                    right: 0;
                    margin-left: 0;
                    margin-right: 0;
                }
                #footermenu ul {
                    height: auto;
                    padding: 8px 0px;
                    margin: 0px;
                }
                #footermenu li {
                    display: inline;
                    padding: 20px;
                }
                #footermenu a {
                    text-decoration: none;
                    color: #00F;
                    // padding: 8px 8px 8px 8px;
                }
                #footermenu a:hover {
                    color: #F90;
                    background-color: #17861A;
                    //color of gover over iterm
                }
                rightleftB {
                    display: table-cell vertical-align: bottom;
                }
                #wrapper {
                    width: 100%;
                }
            </style>
    </html>

I think you need this... 我想你需要这个...

Result 结果

body{

overflow: hidden;

 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM