Sinky's profile☜♡☞小兔子的素材库+教程☜♡☞BlogLists Tools Help

Blog


    January 06

    MSN Space技巧---立体彩色边框

    拥有了背景色彩的日志显得生动活泼了许多,那么如何让她更具特色呢?在这一章里我将向大家讲述如何定制具有立体效果的背景样式。

     

    我们先从为日志文字添加带有色彩的边框说起,因为其涉及到的CSS边框属性语法是以后制作立体效果边框的基础形式。请记住下面这段语法:

     

    <div STYLE="border-style:solid;border-width:5pt; border-color:red">日志文字</div>

     

    它会在你的文字外围生成一个红色边框,border-width控制边框的粗细,border-color调整边框的颜色,这里你仍然何以使用前文提到的形式如#xxxxxx的颜色数值,而border-style则控制边框的效果,当使用“solid”则为单一颜色的线形简单边框。

     

    接下来我们再将上述语法扩展一下,就可以获得具有立体效果的彩色边框。那么从何下手呢?其实就是在border-style后面使用不同的语法描述:

     

    Solid 简单线形边框   Double 简单双线边框   Groove 沟线立体效果边框 Ridge 脊线立体效果边框   Inset 嵌入线立体效果边框  Outset 浮出线立体效果边框

     

    你可以在MSN Space日志中尝试一下上面不同的语法,然后在预览中观看效果。

     

    通过定制边框的方法再将上一教程添加色彩的语法嵌套其中,你就可以创造出具有立体效果的彩色日志背景。

     

    例如:<div STYLE="border-style:outset;border-width:2pt; border-color: red">
    <div style="width:100%;height:100%;background-color:#ffff00;">日志文字
    </div></div>

     

    使用上述语法将会为你呈现一个黄底色红边框的浮出线效果背景,其实上述语法还有其他形式的简化写法,这里不再赘述,只采用上述较直接易理解形式。

     

    对于背景边框的四个边你也可以按自己的需要进行调整,以左边框为例,你可以使用下述语法:

     

    Border-left-style:solid (double, groove, ridge, inset, outset)定制边框样式
    Border-left-color: #xxxxxx定制边框颜色
    Border-left-width: xpt 定制边框粗细


     

    其他三个边框只要分别使用Right, Top, Bottom就可以了。将下面的语法放到你的日志中预览一下,看一看是什么效果:

     

    <div style= "border-top-style:outset;border-right-style:outset;border-left-style:outset;
    border-bottom-style:outset;background-color:#cc3366">

     

    你可以按照自己的想法随意调整四个边框的式样,以便创造与众不同的效果,记住一点,不同的属性描述之间用 ; 隔开。另外,你可能会注意到,当你设置完边框返回到日志文本编辑模式,在键入文字过程中如果使用回车键,就会又出现一个边框,从而影响文字的连贯性,这是因为HTML语法中不支持硬回车。要解决这个问题,必须返回到HTML编辑模式,在需要回车的地方键入<br>,需要几次回车就键入几个<br>,然后再返回到文本编辑模式,你就会发现边框背景内已经为你加入了回车后的效果。

     
    感谢loadmemory的分享!

    Comments (2)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Picture of Anonymous
    Sinky_rabbit1 wrote:
    笑的这么的灿烂你。。。
    那请问你是不是也会给我每天的报酬呢?(玩笑)
    Jan. 6
    Picture of Anonymous
    薄荷叶飘走了 wrote:
    哈哈~~
    真的好巧,我最近到处在找好看的素材,正好碰到你的space了,,谢谢你哟~~我会天天光顾的。
    Jan. 6

    Trackbacks

    The trackback URL for this entry is:
    http://sinkyrabbit.spaces.live.com/blog/cns!1AD3A44A31BE2D9C!245.trak
    Weblogs that reference this entry
    • None