I am almost going moldy staying at home due to the epidemic, so I turned on my computer and used my brain. Today I will share with you a method about the source and origin of CSS3 markup references. The emergence of new technologies often means new improvements in productivity. With the popularity of HTML5 and CSS3, more and more new methods allow us to simply and easily solve things that used to be done with very complicated codes. For example, download and placeholder in HTML5, calculator and counter in CSS3 have greatly reduced the workload of us Web developers, because the emergence of these features saves us a lot of effort. Here, I will introduce to you a method of using the content and attr technology in CSS3 to cleverly mark the author of the quotation or the source of the quotation. If you quote someone else in your article, or quote a passage from a book, you should indicate the person's name or the book's title after the quote. This is not only out of politeness, but also out of respect. Usually we use float:right to make the source appear in the lower right corner of the quotation. But the content and attr technology in CSS3 allows us to achieve it more cleverly. Below is the effect diagram achieved by CSS3. HTML Code
We noticed the cite attribute on the blockquote element. Rather than using a separate element to display the source, we take advantage of the properties of the blockquote itself. This is grammatically clearer and simpler, and semantically more meaningful. CSS Code Next we need to use a small piece of CSS to make the content in the cite attribute display in the appropriate place, which requires the use of content and attr in CSS3: blockquote[cite]:after { background-color: #666666; border: 1px solid #000000; color: #EEEEEE; content: attr(cite); display: block; font-size: smaller; font-style: normal; padding: 0 0.2em; position: absolute; right: 0.5em; } We actually use the :after pseudo-element to display the origin information. No additional web elements are added. Use absolute positioning to position it in the lower right corner, and it also shows a certain sense of hierarchy. Very beautiful. Unless the requirements are particularly high, this method of showing the source or origin of the quotation is very effective. But there are also some impractical aspects, such as you need to add a link to the book. This usage is supported in modern browsers, including Firefox, Google Chrome, and Apple Chrome. IE9 fully supports this method. Summarize This concludes this article on clever ways to mark the origin and source of CSS3 references. For more relevant CSS3 reference and source content, please search 123WORDPRESS.COM’s previous articles or continue browsing the related articles below. I hope that everyone will support 123WORDPRESS.COM in the future! |
<<: How to submit a pure HTML page, pass parameters, and verify identity
>>: Analyzing Linux high-performance network IO and Reactor model
When using MySQL to run certain statements, a dea...
Today we will implement a fragmented image loadin...
This article shares the specific code of the appl...
1. System environment [root@localhost home]# cat ...
Install boost There are many ways to call C/C++ f...
1. Introduction pt-query-digest is a tool for ana...
I recently wrote a script for uploading multiple ...
Table of contents 1. Build basic styles through E...
Without further ado, let me give you the code. Th...
MySQL service 8.0.14 installation (general), for ...
Table of contents 1. Introduction 2. On-demand at...
After learning the basic operations of Docker, we...
If you upgrade in a formal environment, please ba...
First execute the command: [root@mini61 setuptool...
This article shares with you the graphic tutorial...