我想画一个水平线作为照片部分和文本部分之间的中断。用画线的编码问题
这里是我的网站:
这里就是它的工作的jsfiddle:
<script type="text/javascript">
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.moveTo(0,0);
ctx.lineTo(980,0);
ctx.stroke();
</script>
我已经把在头上。这是我的html:
<!-- CONTENT____________________________________________-->
<div class="content_wrapper">
<!-- Photo __________________________________________-->
<div class="home_photo">
</div>
<canvas id="myCanvas" width="980" height="100" style="border:0px solid #d3d3d3;"></canvas>
<!-- About___________________________________________________-->
<div class="home_text">
<p>Emma Carmichael is a writer and editor based in Brooklyn, NY, although she hails from Brattleboro, VT. Emma graduated from Vassar College in 2010 with a degree in Urban Studies; ETC...
</p>
</div>
</div>
这显然是做一些事情,因为元素之间有额外的空间。有任何想法吗?
谢谢!
你不能只使用'
'元素吗? – Pointy 2013-03-26 18:59:54
我试过了,但即使我指定了黑色,它仍然是一个白色的盒子。它也有一个奇怪的边界。明白了吗? http://jsfiddle.net/GCxh9/1/ – Claire 2013-03-26 19:04:33
[它只是需要适当的样式](http://jsfiddle.net/kJNan/) – Pointy 2013-03-26 19:10:47