can directly implement Full-text search in CSS, rather than JavaScript clients.
Create a search box Drop-down menu with CSS3 and HTML
In this tutorial, we'll create a flat-screen navigation and a search Pull-down menu for the
Development notes (www.chhua.com )*/
Adjust the style of the layer that displays the Search Prompt. Because the Search Prompt layer is at the bottom of the search box, we set the positioning method to absolute positioning.
# Search_auto {border: 1px solid #817FB2; position: absolute;}/* set the border and positioning
register the event for the onkeyup in the search box. we still use jQuery to handle the event. in jQuery, the keyup
$ ('# Search input [name = "k"]'). keyup (function (){$. Post ('search _ auto. php ', {'value': $ (this ). val ()}, function (data) {// send post data to search_auto.php on the server, $. post is the jQu
1. Introduction1.1 What is the Box ModelEach element (element) in HTML can be viewed as a rectangular box, which consists of the contents of the element (content), the padding (padding), the border (border), the margin (margin), in turn, from inside to outside.In the layout of CSS, the rectangle of the element is calle
CSS Client
The full-text search of CSS can be directly implemented using indexized data attributes, dynamic styles, and the CSS3 selector, instead of the JavaScript client.
Use CSS3 and HTML to create a drop-down menu in the search bo
Search Prompt layer at the bottom of the search box, and the width is the same as that of the search box. Here we use jQuery to solve this problem.
The Code is as follows:
Detail ('elasticsearch_auto'detail .css ({'width': $ ('
Automatically complete the javascript implementation in the search box.
In many websites that need to be searched, there will be an automatically completed search box. users can search for the search term they want. help users qui
the least tag at any time and maintain the minimum complexity.
VII. attribute order:HTML attributes should be arranged in the following order to ensure the code is easy to understand:1. class2. id, name3. data -*4. src, for, type, href5. title, alt6. Aria, roleClass is used to mark highly reusable components, so it should be placed first.
8. Reduce the number of labelsWhen writing HTML code, try to avoid redundant parent elements. In many cases, this
Development notes (www.chhua.com )*/
Adjust the style of the layer that displays the Search Prompt. Because the Search Prompt layer is at the bottom of the search box, we set the positioning method to absolute positioning.
# Search_auto {border: 1px solid #817FB2; position: absolute;}/* set the border and positioning
Article Introduction: the future of CSS: the transformation of the game Flexbox.
HTML5 and CSS3 provide Web developers with new syntax tags, local animation tools, server-side fonts, and more, these are not the end. Developers are struggling to dig a trench for web design-the real page typesetting tool, in fact, even the most promising CSS3 are still on the horizon.
While it can create surprisingly complex layouts, such as
The search box contains a search prompt indicating to click "disappear code instance" and "code instance ".
In the search box, a search prompt is displayed, indicating that the code is deleted:
There must be no stranger to the
original http://www.cnblogs.com/aobingyan/p/3823556.html, with the deletionAt present, the Chinese website above the text, the majority of the main web site text size of 12px, because in the current high-resolution display screen, 11px of Chinese characters, its pixel start is not regular, the text is not as good as the display of 12px.12px size text is the mainstream is the bottom line. However, the 12px text is not aligned with the radio
When doing the project, the boss let me encapsulate a search function, similar to BaiduAfter entering the character, you can automatically search for data, and there will be a drop-down box for the user to choose, I think my boss has a problem, there are so many plug-ins on the net, not only the package, performance has also been optimized, what functions have, h
CSS assumes that all HTML document elements produce a rectangular element that describes the space occupied by the element in the HTML document layout ( Element box), which can be visualized as a box. CSS creates a "
content, the fill is the padding, and the distance between the boxes is margin. This analogy has its advantages, but it still feels like it is not said (at least I think so ). In addition, this analogy virtually regards padding and content as the content of tag elements, and regards margin as something other than content. It feels that this will cause some deviations in understanding the nature of css layout, the most obvious example is that beginner
(www.chhua.com)*/
Then we'll adjust the layer style of the search hint, because the search tip layer is just below the search box, so we set it to be absolutely positioned.
#search_auto {border:1px solid #817FB2; Position:absolute}/* Set border, positioning mode/*
Then use JS to place the
if the scroll distance of the scroll bar makes the original search box invisible.
Here are some codes for this effect:
Floating search box HTML code: (the displayed search box is the s
navigation (Main menu)
Sub Menu
Search box
Ribbon (e.g. shopping cart, cashier)
Footer (copyright and related legal notices)
We usually use DIV elements to define these structures, like this:
This is not a layout, it is a structure. This is a semantic description of the content block. When you understand your structure, you can add the corresponding ID to the div.
Autopoint. js code:
Copy codeThe Code is as follows :/*
* @ Date: 21:42:15
* @ Author: Hu lingwei
* Depends:
* Jquery. js
*
* Function: similar to the GOOGLE search box prompt function
*/
(Function ($ ){
$. Fn. autopoint = function (options ){
Defaults = {
Url: options. url,
KeyLeft: 37, // left direction key
KeyUp: 38, // up arrow key
KeyRight: 39, // right direction key
KeyDown: 40, // downward direction
PrefaceIf you want to try to typeset web pages without using tables, you can use CSS to typeset your web pages, that is, you can often use DIV to orchestrate your web page structure, or you want to learn about the standard design of web pages, or your boss wants you to change the traditional form layout mode to improve the competitiveness of enterprises, one of the things you must understand is the CSS
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.