Use code to "write" a scan line effect picture

Source: Internet
Author: User
We generally use Photoshop, such as drawing tools to make TV scan line effect Picture: First do a black-and-white pattern, and then fill with this pattern, and then adjust the pattern or transparency of the layer, the effect came out.

Now we do not use Photoshop, CSS and JavaScript, and the method is simple!

One, the preparation of a picture, named Photo1.jpg, size: 240x180;


Second, insert a table, the table long x width set to 240x180, the cellpadding, cellspacing, border are set to 0, and the background of the table set to the above picture, that code is: <table cellpadding= "0" cellspacing= "0" border= "0"
Width= "height=" "180" background= "Photo1.jpg" >
</table>
Third, create a CSS style, apply the style to the above table, the style code is as follows. #000000代表黑色, you can also change to other colors you like. The following Filter:alpha (OPACITY=30) is a CSS filter that adjusts the transparency of thin lines. <BR><BR> TVLine td{border-top:1 solid #000000; Font:1px;filter:alpha (opacity=30)} Iv. Insert a small snippet of JavaScript code in a table:
for (n=1;n ')//note TD has a full-width space in the middle;//document.write (")///In view of browser compatibility, you can also use the above sentence
The code for the entire page is as follows:
. tvline td{border-top:1 solid #000000; Font:1px;filter:alpha (opacity=30)} for (N=1;n ')
Now save the page and preview the effect:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.