tecent面试题解答

题目在这

http://www.chinesefeng.com/default.asp?tag=%E6%8B%9B%E8%81%98%E8%AF%95%E9%A2%98

二个的实现

 

ContractedBlock.gif ExpandedBlockStart.gif Code
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
#x1
{
width
:150px;
background-color
:red;
height
:50px;
left
:50%;
top
:50%;
position
:absolute;
margin-top
:-25px;
margin-left
:-75px;}
#x2
{
width
:50px;
height
:150px;
background-color
:red;
left
:50%;
top
:50%;
position
:absolute;
margin-left
:-25px;
margin-top
:-75;}
</style>
</HEAD>

<BODY>
<div id="x1"></div>
<div id="x2"></div>
</BODY>
</HTML>

 

三个的实现

 

ContractedBlock.gif ExpandedBlockStart.gif Code
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
<!--
/*这三个css有很多雷同的样式,怎么样重构哪*/
#x
{width:50px;height:150px;position:absolute;left:50%;top:50%;margin-left:-25px;margin-top:-75px;background-color:red;}
#y
{width:50px;height:50px;position:absolute;left:50%;top:50%;margin-left:-75px;margin-top:-25px;background-color:red;}
#z
{width:50px;height:50px;position:absolute;left:50%;top:50%;margin-left:25px;margin-top:-25px;background-color:red;}
-->
</style>
</HEAD>

<BODY>
<div id="x"></div><div id="y"></div><div id="z"></div>
</BODY>
</HTML>
ContractedBlock.gif ExpandedBlockStart.gif Code
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
<!--
/*这三个css有很多雷同的样式,这样重构哪*/
div 
{width:50px;position:absolute;left:50%;top:50%;background-color:red;}
#x
{height:150px;margin-left:-25px;margin-top:-75px;}
#y
{height:50px;margin-left:-75px;margin-top:-25px;}
#z
{height:50px;margin-left:25px;margin-top:-25px;}
-->
</style>
</HEAD>

<BODY>
<div id="x"></div><div id="y"></div><div id="z"></div>
</BODY>
</HTML>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值