在中心显示图像和文本浮动到图像CSS的问题 [英] Problem with displaying image in center and text to float right to image css
本文介绍了在中心显示图像和文本浮动到图像CSS的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在这里我想在中间显示图像,然后在该图像的右边我想显示Company 1 |欢迎管理员|注销
这是我的问题,这是公司1 |欢迎管理员|在下一行注销
你能告诉我这很有趣吗?
here i want to display image in center then right to that image i want to display Company 1 | Welcome admin |Logout
here my problem is am getting this thing Company 1 | Welcome admin |Logout in next line
can u tell me y this is hapening .
<header>
<div style="top: 0px; padding: 5px; background-color: black;">
<div style="text-align:center;margin-left:auto;margin-right:auto;width:40%">
<img src="~/Content/Images/JPL_Logo.PNG" />
</div>
<div style="color:#FFFF33;height:30px;float:right;">
Company 1 | Welcome admin | <a href="~/Login/Create" style="color:yellow !important;">Logout</a>
</div>
<div class="cleardiv"></div>
</div>
<div style="padding: 0px; background-color: black;">
@Html.Partial("~/Views/Shared/Navigation.cshtml")
</div>
</header>
推荐答案
尝试一下
Try this
<header>
<div style="top: 0px; padding: 5px; background-color: black;">
<div style="text-align:center;margin-left:auto;margin-right:auto;">
<div style="float:left; width:80%">
<img src="Content/Images/JPL_Logo.PNG" height="100px" width="100px" />
</div>
<div style="color:#FFFF33;height:30px;float:right;">
Company 1 | Welcome admin | <a href="~/Login/Create" style="color:yellow !important;">Logout</a>
</div>
</div>
<div class="cleardiv"></div>
</div>
</header>
这篇关于在中心显示图像和文本浮动到图像CSS的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文