[英]How to align a image to a paragraph to the right
[scrollspy samp[scrollspy][1]le]
now having removed the padding in the about us section, the scrollspy is not aligning to the about us, i need help on how to fix the scollspy while maintaining the picture aligned to the paragraph.现在已经删除了关于我们部分的填充,scrollspy 没有与关于我们对齐,我需要有关如何修复 scollspy 的帮助,同时保持图片与段落对齐。
</style>
</head>
<body id="#navbar" data-spy="scroll" data-target="navbar" data-offset="10">
<nav id="#navbar" class="navbar navbar-expand-sm navbar-light bg-light fixed-top">
<a href="#" class="navbar-brand">
<img src="logo.png" alt="Logo" style="width:80px;">
<div class="collapse navbar-collapse">
<ul class="navbar-nav ml-auto">
<li class="navbar-nav">
<a class="nav-link" href="#About Us">About Us</a>
</li>
<li class="nav-item">
<a href="#Services" class="nav-link">Services</a>
</li>
<li class="nav-item">
<a href="#Porfolio" class="nav-link">Porfolio</a>
</li>
<li class="nav-item">
<a href="#Contact Us" class="nav-link">Contact Us</a>
</li>
</ul>
</div>
Remove the padding-top:85px
style attribute from the "About Us" div
- that creates a 85px high white space which apparently you don't want.从“About Us” div
中删除padding-top:85px
样式属性 - 这会创建一个 85px 高的空白区域,这显然是您不想要的。
Also, the h2
in there will have a relatively high default top-margin
which also creates white space above the text, so you might want to add margin-top: 0
to that h2
.此外,其中的h2
将具有相对较高的默认top-margin
,这也会在文本上方创建空白,因此您可能希望将margin-top: 0
添加到该h2
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.