搜索
首页web前端html教程大家帮忙看看这两个div之间为什么没有分隔了?_html/css_WEB-ITnose

想要下面图这个左栏和右栏之间有一个分隔,通过限定左面那个width值和margin-right值,然后float左面,右面margin-left也是10px,但是不知道为啥总是分不出来?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">  <head>    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />    <title>Starbuzz Coffee</title>    <link rel="stylesheet" type="text/css" href="starbuzz.css" />  </head>   <body>  	<div id="allcontent">	    <div id="header">	      <img src="/static/imghwm/default1.png"  data-src="images/header.gif"  class="lazy"   alt="Starbuzz Coffee header image" />	    </div>	    <div id="main">	      <h1 id="QUALITY-nbsp-COFFEE-nbsp-QUALITY-nbsp-CAFFEINE">QUALITY COFFEE, QUALITY CAFFEINE</h1>	      <p>	        At Starbuzz Coffee, we are dedicated to filling all your  caffeine needs through our 	        quality coffees and teas. Sure, we want you to have a great cup of coffee and a great 	        coffee experience as well, but we're the only company that actively monitors and 	        optimizes caffeine levels. So stop by and fill your cup, or order online with our new Bean 	        Machine online order form, and get that quality Starbuzz coffee that you know will meet 	        your caffeine standards.	      </p>	      <p>	        And, did we mention <em>caffeine</em>? We've just started funding the guys doing all 	        the wonderful research at the <a href="http://buzz.headfirstlabs.com"	        title="Read all about caffeine on the Buzz">Caffeine Buzz</a>.	        If you want the latest on coffee and other caffeine products, 	        stop by and pay them a visit.	      </p>	      <h1 id="OUR-nbsp-STORY">OUR STORY</h1>	      <p>	        "A man, a plan, a coffee bean". Okay, that doesn't make a palindrome, but it resulted	        in a damn good cup of coffee.  Starbuzz's CEO is that man, and you already know his 	        plan: a Starbuzz on every corner.	      </p> 	      <p>In only a few years he's executed that plan and today 	        you can enjoy Starbuzz just about anywhere.  And, of course, the big news this year 	        is that Starbuzz teamed up with Head First readers to create Starbuzz's Web presence,  	        which is growing rapidly and helping to meet the caffeine needs of a whole new set of 	        customers.  	      </p>	      <h1 id="STARBUZZ-nbsp-COFFEE-nbsp-BEVERAGES">STARBUZZ COFFEE BEVERAGES</h1>	      <p>	        We've got a variety of caffeinated beverages to choose	        from at Starbuzz, including our 	        <a href="beverages.html#house" title="House Blend">House Blend</a>,	        <a href="beverages.html#mocha" title="Mocha Cafe Latte">Mocha Cafe Latte</a>, 	        <a href="beverages.html#cappuccino" title="Cappuccino">Cappuccino</a>,	        and a favorite of our customers, 	        <a href="beverages.html#chai" title="Chai Tea">Chai Tea</a>.	      </p>	      <p>	        We also offer a variety of coffee beans, whole or ground, for you to	        take home with you.  Order your coffee today using our online	        <a href="form.html" title="form.html">Bean Machine</a>, and take	        the Starbuzz Coffee experience home.	      </p>	    </div>	    	    <div id="sidebar">	      <p class="beanheading">	        <img src="/static/imghwm/default1.png"  data-src="images/bag.gif"  class="lazy"   alt="Bean Machine bag" />	        <br />	        ORDER ONLINE	        with the 	        <a href="form.html">BEAN MACHINE</a>	        <br />	        <span class="slogan">	            FAST <br />	            FRESH <br />	            TO YOUR DOOR <br />	        </span>	      </p>	      <p>	        Why wait?  You can order all our fine coffees right from the Internet with our new, 	        automated Bean Machine.  How does it work?  Just click on the Bean Machine link, 	        enter your order, and behind the scenes, your coffee is roasted, ground 	        (if you want), packaged, and shipped to your door.	      </p>	    </div>		    <div id="footer">	      &copy; 2005, Starbuzz Coffee	      <br />	      All trademarks and registered trademarks appearing on 	      this site are the property of their respective owners.	    </div>	  </div>  </body></html>

相关的CSS代码
#header {  background-color: #675c47;  margin:           10px;  height:           108px;}#main {  background:       #efe5d0 url(images/background.gif) top left;  font-size:        105%;  padding:          15px;  margin:           0px 10px 10px 10px;  width:						420px;  float:						left;}#sidebar {  background:       #efe5d0 url(images/background.gif) bottom right;  font-size:        105%;  padding:     			10px;  margin:           0px 10px 10px 10px;}


回复讨论(解决方案)

把图给补上去

贴出来的 代码和样式不全,无法帮你找到原因,
可以重新贴一次,或者加我q:1157373706  发文件给,我帮你看看

贴出来的 代码和样式不全,无法帮你找到原因,
可以重新贴一次,或者加我q:1157373706  发文件给,我帮你看看
你好,已经发邮件给你了。

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
如何验证您的HTML代码?如何验证您的HTML代码?Apr 24, 2025 am 12:04 AM

HTML代码可以通过在线验证器、集成工具和自动化流程来确保其清洁度。1)使用W3CMarkupValidationService在线验证HTML代码。2)在VisualStudioCode中安装并配置HTMLHint扩展进行实时验证。3)利用HTMLTidy在构建流程中自动验证和清理HTML文件。

HTML与CSS和JavaScript:比较Web技术HTML与CSS和JavaScript:比较Web技术Apr 23, 2025 am 12:05 AM

HTML、CSS和JavaScript是构建现代网页的核心技术:1.HTML定义网页结构,2.CSS负责网页外观,3.JavaScript提供网页动态和交互性,它们共同作用,打造出用户体验良好的网站。

HTML作为标记语言:其功能和目的HTML作为标记语言:其功能和目的Apr 22, 2025 am 12:02 AM

HTML的功能是定义网页的结构和内容,其目的在于提供一种标准化的方式来展示信息。1)HTML通过标签和属性组织网页的各个部分,如标题和段落。2)它支持内容与表现分离,提升维护效率。3)HTML具有可扩展性,允许自定义标签增强SEO。

HTML,CSS和JavaScript的未来:网络开发趋势HTML,CSS和JavaScript的未来:网络开发趋势Apr 19, 2025 am 12:02 AM

HTML的未来趋势是语义化和Web组件,CSS的未来趋势是CSS-in-JS和CSSHoudini,JavaScript的未来趋势是WebAssembly和Serverless。1.HTML的语义化提高可访问性和SEO效果,Web组件提升开发效率但需注意浏览器兼容性。2.CSS-in-JS增强样式管理灵活性但可能增大文件体积,CSSHoudini允许直接操作CSS渲染。3.WebAssembly优化浏览器应用性能但学习曲线陡,Serverless简化开发但需优化冷启动问题。

HTML:结构,CSS:样式,JavaScript:行为HTML:结构,CSS:样式,JavaScript:行为Apr 18, 2025 am 12:09 AM

HTML、CSS和JavaScript在Web开发中的作用分别是:1.HTML定义网页结构,2.CSS控制网页样式,3.JavaScript添加动态行为。它们共同构建了现代网站的框架、美观和交互性。

HTML的未来:网络设计的发展和趋势HTML的未来:网络设计的发展和趋势Apr 17, 2025 am 12:12 AM

HTML的未来充满了无限可能。1)新功能和标准将包括更多的语义化标签和WebComponents的普及。2)网页设计趋势将继续向响应式和无障碍设计发展。3)性能优化将通过响应式图片加载和延迟加载技术提升用户体验。

HTML与CSS vs. JavaScript:比较概述HTML与CSS vs. JavaScript:比较概述Apr 16, 2025 am 12:04 AM

HTML、CSS和JavaScript在网页开发中的角色分别是:HTML负责内容结构,CSS负责样式,JavaScript负责动态行为。1.HTML通过标签定义网页结构和内容,确保语义化。2.CSS通过选择器和属性控制网页样式,使其美观易读。3.JavaScript通过脚本控制网页行为,实现动态和交互功能。

HTML:是编程语言还是其他?HTML:是编程语言还是其他?Apr 15, 2025 am 12:13 AM

HTMLISNOTAPROGRAMMENGUAGE; ITISAMARKUMARKUPLAGUAGE.1)htmlStructures andFormatSwebContentusingtags.2)itworkswithcsssforstylingandjavascript for Interactivity,增强WebevebDevelopment。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

螳螂BT

螳螂BT

Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

SecLists

SecLists

SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

mPDF

mPDF

mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

MinGW - 适用于 Windows 的极简 GNU

MinGW - 适用于 Windows 的极简 GNU

这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。