如何在导航栏中居中我的徽标?(How do I center my logo in the navigation bar?)
如何将我的徽标置于导航栏中? 我已经将它集中在一起,但我遇到的问题是当我在内容区域放置图像时,图像会覆盖徽标的一部分。 我确实希望徽标从导航链接中略微下降。 我不希望徽标和内容图像之间有一个巨大的空间。 有没有办法实现这个目标? 附加的图像是我想要完成的设计。 提前致谢!
body { font-family:Georgia; font-size:12pt; } * { margin:0; padding:0; } #header { background-color:#000000; height:100px; margin:auto; } #header ul { margin:0 auto; width:35%; padding:12px; list-style: none; } #header li { float: left; } #header a { padding:0 14px; text-align:center; display:block; text-decoration:none; color:#FFFFFF; font-size:18pt; } #header ul li a.logo { background: url("Logo.png"); background-repeat:no-repeat; height:140px; display:block; width:140px; padding: 0; .clearfix { *zoom: 1; } .clearfix:after { content: ""; clear: both; display: table; } #MainContent { } #MainContent img { margin-top:-10px; position:absolute; left:0; width:100%; } }
<body> <div id="header" class="clearfix"> <ul class="Nav"> <li><a href="index.html">Home</a></li> <li><a href="menu.html">Menu</a></li> <li><a href="index.html" class="logo"></a></li> <li><a href="gallery.html" >Gallery</a></li> <li><a href="about.html">About</a></li> </ul> </div> <div id="MainContent"> <img src="Photos/drinks.jpeg"> </div> </body>
How do I center my logo in my Navigation bar? I kind of already have it centered, but the issue that I'm running into is when I place an image in the content area, the image covers up part of the logo. I do want the logo kind of dropped a little from the navigation links. I don't want a giant space between the logo and the content image. Is there a way I can achieve this? The image attached is the design I'm trying to accomplish. Thanks in advance!
body { font-family:Georgia; font-size:12pt; } * { margin:0; padding:0; } #header { background-color:#000000; height:100px; margin:auto; } #header ul { margin:0 auto; width:35%; padding:12px; list-style: none; } #header li { float: left; } #header a { padding:0 14px; text-align:center; display:block; text-decoration:none; color:#FFFFFF; font-size:18pt; } #header ul li a.logo { background: url("Logo.png"); background-repeat:no-repeat; height:140px; display:block; width:140px; padding: 0; .clearfix { *zoom: 1; } .clearfix:after { content: ""; clear: both; display: table; } #MainContent { } #MainContent img { margin-top:-10px; position:absolute; left:0; width:100%; } }
<body> <div id="header" class="clearfix"> <ul class="Nav"> <li><a href="index.html">Home</a></li> <li><a href="menu.html">Menu</a></li> <li><a href="index.html" class="logo"></a></li> <li><a href="gallery.html" >Gallery</a></li> <li><a href="about.html">About</a></li> </ul> </div> <div id="MainContent"> <img src="Photos/drinks.jpeg"> </div> </body>
原文:https://stackoverflow.com/questions/44378489
最满意答案
你可以改变它之前验证输入
int
。def GetHumanPlayerMove(player_name): print(player_name, "enter the coodinates of the square where you want to place your piece: ", end="") inp = input() if inp and inp.isdigit(): coordinates = int(inp) else: return 0 return coordinates
函数返回
0
,如果接收到无效的输入,否则结果本身end=""
使印刷品保持在同一直线上,并且不发送\n
(新行)You can validate input before change it to
int
.def GetHumanPlayerMove(player_name): print(player_name, "enter the coodinates of the square where you want to place your piece: ", end="") inp = input() if inp and inp.isdigit(): coordinates = int(inp) else: return 0 return coordinates
function returns
0
if receives invalid input, else the result itselfend=""
make the prints keep in the same line and don't send\n
(new line)
相关问答
更多-
你可以改变它之前验证输入int 。 def GetHumanPlayerMove(player_name): print(player_name, "enter the coodinates of the square where you want to place your piece: ", end="") inp = input() if inp and inp.isdigit(): coordinates = int(inp) else: return 0 re ...
-
减法2坐标(Subtraction 2 coordinate)[2023-01-31]
E-8是科学记数法 ,意思是10-power-8。 计算工作正常,它只是打印小或大的浮点值,将格式转换为科学E符号。 The E-8 is scientific notation, meaning 10 to the power -8. The calculation works all right, it's just printing small or large floating point values that turns the formatting to scientific E notati ... -
解决此类任务的一种方法始终有效: 1)将lat,lon转换为基于抄表的笛卡尔坐标系(4-5)代码行。 在你的情况下,我会在变换代码中使用椭圆中心作为“中心”(例如,圆柱等距投影需要一个中心纬度) 2)然后使用学校数学,来解决任务:使用椭圆方程。 这一切都假设椭圆与ae平行于aequator。 如果没有更新您的问题。 I have solved this by using some mathematical calculations from Google and guidance from the (ver ...
-
对齐坐标系(Aligning coordinate systems)[2022-06-12]
重要的信息是第二个坐标系的起源 - 即(a,b) 。 一旦你知道,你所需要的只是: QPointF pos1; // original position QTransform t; t.scale(1, -1); t.translate(a, -b+1); QPointF pos2 = pos1 * t; The important piece of information is where is the second coordinate system's origin - namely (a,b). ... -
要获得tile的范围,可以使用ol.tilegrid.TileGrid#getTileCoordExtent : var tileGrid = new ol.source.XYZ().getTileGrid(); concole.log(tileGrid.getTileCoordExtent([0, 0, 0])); To get the extent of a tile, you could use ol.tilegrid.TileGrid#getTileCoordExtent: var tile ...
-
请尝试以下代码以防止数字四舍五入。 print(coordinate) print(coordinate.latitude.debugDescription) print(coordinate.longitude.debugDescription) 结果: CLLocationCoordinate2D(纬度:-33.499989999999997,经度:150.255)-33.499989999999997 150.255 注意: coordinate.latitude / coordinate.long ...
-
只显示一个坐标(showing only one coordinate)[2022-12-23]
我假设你想要返回一个String和x和y坐标。 因此,您应该能够分别访问d对象中的每个坐标,并使用+运算符将它们连接起来: ascatter.append("title") .text(function(d,i) { return "x: " + d.a + "y: " + d.b; }); I'm assuming you want to return a String with the x and y coordinates. So you should be able to ... -
因为您只需要显示矩阵式输出,所以您不需要使用Console.SetCursorPosition(x, y); 此外,您应该以某种方式读取用户输入并为给定位置设置正确的值,而不是存储坐标。 试试这个,让我知道这对你有用。 你可以在这个小提琴上看到它。 输入坐标作为两个以空格分隔的数字,然后输入stop to print。 using System; public class Program { public static void Main(string[] args) { ...
-
validates :fax, format: {with: VALID_PHONE_REGEX}, :unless => 'fax.blank?' validates :fax, format: {with: VALID_PHONE_REGEX}, :unless => 'fax.blank?'
-
您尝试在测试存在之前打开该文件 import os import re fname = input("Enter Filename: ") if os.path.isfile(fname): print("file does exist at this time") print("words:", re.findall(r"\w+", open(fname).read())) else: print("no such file") 如果将其包装在异常处理程序中,则立即打开文件会很 ...