gpt4 book ai didi

html - float : right; not floating all the way

转载 作者:太空宇宙 更新时间:2023-11-04 02:17:10 25 4
gpt4 key购买 nike

我正在尝试制作一个简单的页脚框,左边有一些文本,右边有一些文本,但是当我将文本的右边位设置为 float: right; 时,它只会发生60% 的路向右。

如果这太简单了,我深表歉意,但我一直在研究它,就是无法理解。

这是我的 CSS 和 HTML 代码以供引用。 (忽略空类,它们留待以后使用)

CSS:

@import url(https://fonts.googleapis.com/css?family=Oswald:400,700,300);

html {
font-family: 'Oswald', sans-serif;
font-weight: 300;
font-size: 20px;
background-image: url('images/backgrounds/wallpaper.jpg');
background-size: 100%;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
color: RGBA(255,255,255,0.6);
}

body {
width: 70%;
margin: auto;
background-color: RGBA(200,200,200,0.4);
border-width: 1px;
border-style: solid;
border-color: #FFFFFF;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
padding-bottom: 20px;
padding-top: 10px;
border-radius: 6px;
}

div {

width: 95%;
margin: auto;
background-color: RGBA(50,50,50,0.95);

}

.alignleft {float: left;}

.alignright {float: right;}

.header {

border-top-left-radius: 10px;
border-top-right-radius: 10px;

}


.main {



}

.footer{

margin: auto;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
padding-top: 10px;
padding-bottom: 5px;
padding-left: 15px;
padding-right: 15px;

}

.footerText {

font-size: 13px;
color: RGBA(255,255,255,0.3);
width: 350px;

}

HTML:

<!DOCTYPE html>

<html>

<head>

<title>Site for Things and Stuff</title>

<!-- Style Sheets/Scripts/Misc Stuff -->
<link rel="stylesheet" type="text/css" href="style.css">


</head>

<body>

<div class='header'>HEADER TEST HEADER TEST</div>
<div class='main'>MAIN CONTENT TEST MAIN CONTENT TEST</div>


<!-- Footer -->
<div class='footer'>
<p class="footerText alignleft">No images are owned by this website unless specified.
<br><br>To recieve help with an issue on the website or other matters, please use the contact button above.</p>
<p class="footerText alignright">Test test test</p>
<div style="clear:both"></div>

</div>
</body>
</html>

最佳答案

.alignright类中添加text-align:right;

.alignright {
float: right;
text-align:right;
}

关于html - float : right; not floating all the way,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38709145/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com