将水平菜单和页脚链接设置为右侧

时间:2014-03-21 16:05:50

标签: css html html-lists footer

我无法将菜单设置为一直到页面右侧,我的页脚也会链接。这是我的http://prntscr.com/32snbr,这就是我想要的http://prntscr.com/32snrm

这是我的HTML,请帮忙

<head>
    <title>Index</title>
    <meta name="description" content="Lab exercise 4">
    <meta name="keywords" content="FINKI, Lab Exercise, Web design">
    <style>
    body{
    background-color: #F5F5F5;
    color: #4f8295;
    }

    li
    {   
    float:left;     
    }
    ul.foot{
    display:inline; 
    list-style-type:none;
    }   
    </style>
</head>

<body>
    <div style="width: 100%; margin-left: auto; margin-right: auto; margin-top: 0;   margin-bottom: 0; max-width: 62.5rem; background: #fff; padding: 15px;"> 
        <div style="display:inline-block; width:49%;">
            <img src="ukim-logo-9.png"/>
            <img src="finki-logo-9-en.png"/>
        </div>
            <div style="display: inline-block; vertical-align: top; width: 50%; text-align: left; float:right; padding-top:15px;"> 
                <ul class="foot">
                    <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
                        <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="http://127.0.0.1:8020/Lab4/lab4.1.html">Home</a></li>
                    </div>
                    <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
                    <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="http://127.0.0.1:8020/Lab4/lab4.2.html">News</a></li>
                    </div>
                    <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
                    <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="http://127.0.0.1:8020/Lab4/lab4.3.html">Contact</a></li>
                    </div>
                    <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
                    <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="#about">About</a></li>
                    </div>
                </ul>
            </div>

        <hr style="border: solid #dddddd; border-width: 1px 0 0; clear: both; margin: 1.25rem 0 1.1875rem; height: 0;">

    <div style="display: inline-block; width: 65%; padding-left: 20px;">
            <div style="display: inline-block; width:100%">
                <h1 style="font-size: 40px; margin-bottom:0;">Get in touch</h1>
                <h3  style="margin-top:0;">Contact content</h3>
            </div>
            <div style="display: inline-block; width:100%; ">
                <p >Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet 
                    dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper 
                    suscipit lobortis nisl ut aliquip ex ea commodo consequat. 
                </p>
                <p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu 
                    feugiat nulla facilisis at vero eros et accumsan 
                    et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
                    Nam liber tempor cum soluta nobis eleifend option congue. 
                </p>                        
            </div>

        </div>

        <div style="display: inline-block; width: 30%;vertical-align: top">
            <div style="display: inline-block; ">
                <p>Map</p>
                    <img style=" display: inline-block; padding-right: 20px; max-height: 100%; max-width: 100%" src="gmaps.JPG">
                <p>Awesome St. <br>1000 Skopje, MK</p>
            </div>
        </div>  

        <hr style="border: solid #dddddd; border-width: 1px 0 0; clear: both; margin: 1.25rem 0 1.1875rem; height: 0;">

        <div>
            <div style="display: inline-block; width: 100%;">
                <div style="display: inline-block; width: 50%;">
                    <footer>
                        <span>&copy; Faculty for Computer Science and Engineering - Skopje</span>                       
                    </footer>
                </div>
                <div style="display: inline-block; width: 49%; text-align: right; "> 
                    <ul class="foot">
                        <li><a style="padding: 15px" href="http://127.0.0.1:8020/Lab4/lab4.1.html">Home</a></li>
                        <li><a style="padding: 15px" href="http://127.0.0.1:8020/Lab4/lab4.2.html">News</a></li>
                        <li><a style="padding: 15px" href="http://127.0.0.1:8020/Lab4/lab4.3.html">Contact</a></li>
                        <li><a style="padding: 15px" href="#about">About</a></li>
                    </ul>
                </div>
            </div>
        </div>              

    </body>

2 个答案:

答案 0 :(得分:0)

尝试将此添加到您的样式部分

.footerright{
align: right; 
}

然后使用此替换替换页脚中的内容。

<div class="footerright">
    <ul class="foot">
        <li><a style="padding: 15px" href="http://127.0.0.1:8020/Lab4/lab4.1.html">Home</a></li>
        <li><a style="padding: 15px" href="http://127.0.0.1:8020/Lab4/lab4.2.html">News</a></li>
        <li><a style="padding: 15px" href="http://127.0.0.1:8020/Lab4/lab4.3.html">Contact</a></li>
        <li><a style="padding: 15px" href="#about">About</a></li>
    </ul>
</div>

答案 1 :(得分:0)

<div style="width: 100%; margin-left: 5px; margin-top: 0px; margin-bottom: 0px; max-width: 62.5rem; background: #fff; padding: 15px;"> 
    <div style="display:inline-block; width:49%;">
        <img src="ukim-logo-9.png"/>
        <img src="finki-logo-9-en.png"/>
    </div>
</div>
<div style="display: inline-block; margin-right: 5px; vertical-align: top; width: 50%; text-align: right; float:right; padding-top:15px;"> 
    <ul>
        <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
            <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="http://127.0.0.1:8020/Lab4/lab4.1.html">Home</a></li>
        </div>
        <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
        <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="http://127.0.0.1:8020/Lab4/lab4.2.html">News</a></li>
        </div>
        <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
        <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="http://127.0.0.1:8020/Lab4/lab4.3.html">Contact</a></li>
        </div>
        <div style="display: inline-block; vertical-align: top; margin-left: auto; margin-right: auto; padding-top:15px;">  
        <li><a style="background-color: #008cba; text-decoration: none; border-color: #007295; color: white; padding: 15px;" href="#about">About</a></li>
        </div>
    </ul>
</div>