Use CSS to replace the indexing HTML tag with replace

Source: Internet
Author: User
Tags html tags xslt client
css|html Mark

In fact, CSS is also a powerful tool for separating HTML from data and performance. The CSS orienteddesign of the stone: Cod is very good to my taste, the rejection of Tod (Table oriented) is really not an easy thing to do, but once realized, The system itself has achieved the division of labor and collaboration: it can change the skin like Winamp, so as to play the user's greatest initiative. The most direct example is the MT system used on this website, all style is from Movablestyle.

Requirements: The <b> in the XML result set is displayed in red, which can be achieved through the CSS of the client:
The code is as follows:

First of all

<blockquote>

Use CSS instead of replace <b> tag </b>html tags via replace

</blockquote>

Use CSS instead of replace <b> tag </b>html tags via replace

Such
Defined in CSS: b {color:red;}

After all the <b> in addition to the bold, there are red attributes, in order to prevent the entire page of other <b> are marked red, I will put the results in a <
Blockquote>

, and then define in CSS:

<style><!--

blockquote b {color:red;}

-->

</style>

Because of the inheritance relationship of CSS, only all <b> in blockquote will be marked red:

You can even make <b> fonts thinner by setting Font-weight:normal.

Through this question: Draw 2 conclusions
1 when designing an external search service with indexing, you can use <b> as a marker
2 in the client, you can use CSS to achieve control.

About: CSS, Accesibility and standards Links

Postscript:
has also been a period of time very much to pursue the XML/XSLT/CSS data/structure/performance separation concept. But XSLT implementation costs are really high, so the lightweight template technology based on XHTML has been developed on resin, and I think it's kind of human. The implementation of ASP. NET is similar.

There may not be the best model, only the most appropriate pattern: the key or the complexity of the development itself
Hundreds of lines of code procedural programming efficiency may be the highest;
Thousands of lines of code may be the most efficient for function development;
Wan The amount of code, you may have to OO;







Related Article

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.