HTML table Label Style introduction (also attached HTML5 table CSS Center instance), this article is mainly about the HTML5 table label definition and various styles introduced.
Definition and usage of HTML 5
Standard properties for HTML table tags:
Class, Contenteditable, ContextMenu, dir, draggable, id, irrelevant,
Lang, ref, Registrationmark, TabIndex, template, title
An example of an HTML table style
Div CSS Sprites sprite-css image flattening CSS map positioning Web Background Footage picture flattening positioning layout Technology tutorial and CSS Sprites example chapterCSS Sprites flattening background image footage for layout effectsfirst, What is
Display the image in the center of the div in jsp, as shown in figureExample:Copy codeThe Code is as follows:// CSS File// Body File If the image is in html, the image is centered, but the image is horizontally centered in jsp. In this case, we need to Copy codeThe Code is as follows: Adding the image in Jsp will be ce
In the JSP, let the picture be centered in the Div, as shown above
Example:
Copy Code code as follows:
CSS file
Body file
If in the HTML, there will be that effect on the diagram, the picture is centered, but the picture in the JSP only horizontally centered, in this case, we need to
Copy Code co
The biggest headache for div and CSS layout is the vertical center of things in the container. I also encountered this problem when I was doing the station. I checked the information and summarized the following method of center, compatible with IE and Firefox
HTML code [Ctrl + A select all tips: you can modify s
Horizontal vertical has always been a classic problem, recently wrote a page style encountered this problem, this time need to horizontal vertical center is more than multiple lines of P block, the code is as follows:
This time using the flex layout, because the browser will help us calculate the flex layout, where the parent element needs to be flex layout, there will be a main axis and a vertical intersection in the flex layout, the spindle is
In fact, the idea of the solution is this: the first need position:absolute; absolute positioning. Instead of the layer's anchor point, use the external patch margin negative method. The negative size is the height of the layer itself divided by two.Such as: A layer width is 400, the height is 300. Use absolute positioning distance between upper and left is set to 50%. And the value of Margin-top is-150. The value of Margin-left is-200. This allows us to write a style that is vertically centered
body and table elements.
Bordercolor= "#FFFFFF" Border-color: #fff; Any element can be set to a border (Boeder), you can define top, right, bottom, and left
Border= "3" cellspacing= "3" BORDER-WIDTH:3PX; With CSS, you can define a table's border as a uniform style, or you can define the color, size, and style of top, right, bottom and left borders, respectively.
You can use table, TD or th these selectors.
If you need to set no border effect, you can
elements.
Bordercolor= "#FFFFFF" Border-color: #fff; Any element can be set to a border (Boeder), you can define top, right, bottom, and left
Border= "3" cellspacing= "3" BORDER-WIDTH:3PX; With CSS, you can define a table's border as a uniform style, or you can define the color, size, and style of top, right, bottom and left borders, respectively.
You can use table, TD or th these selectors.
If you need to set no border effect, you can use the
and table elements.
Bordercolor= "#FFFFFF" Border-color: #fff; Any element can be set to a border (Boeder), you can define top, right, bottom, and left
Border= "3" cellspacing= "3" BORDER-WIDTH:3PX; With CSS, you can define a table's border as a uniform style, or you can define the color, size, and style of top, right, bottom and left borders, respectively.
You can use table, TD or th these selectors.
If you need to set no border effect, you can use
I believe that all the front-end cainiao will be the same as me when they first started working, and they will receive the need to center.
There are too many CSS center posts on the Internet, but most of them do not have a good conclusion (or there are good but I have no luck)
Write one for yourself today, which is also a summary of previous work.
1. horizontal
We know that the position attribute of the DIV supports the percentage value for positioning. With this positioning capability, we can locate the display coordinate of the DIV in the absolute center of the webpage, set the DIV to the width and height required by us through the margin attribute. Of course, we need to us
top, right, bottom, and left
Border= "3"
cellspacing= "3" BORDER-WIDTH:3PX; With CSS, you can define a table's border as a uniform style, or you can define the color, size, and style of top, right, bottom and left borders, respectively.
You can use table, TD or th these selectors.
If you need to set no border effect, you can use the CSS definition: border-collapse:collapse;
Clear:left;
Clear:right;
Clear
html> head> meta charset="UTF-8"> title>Edith Academy Small exampletitle> head> style type="Text/css">/ * Full-frequency transparent div*/of this style settingDiv { position: Absolute ; z-index: 1 ; width: 100% ;/ * The benefit of pressing the% ratio by the available width of the body is that it can be changed with the window size * / height: 100% ;/ * Press the body's available height * /Left
I see the recent microblogging popular CSS center technology, I read a few pieces of information to write is not much good, so the time to take the relevant data integration, the specific contents are as follows.
Click here to download the source
Effect Display:
Requirements:
1. Compatible with more browsers as far as possible, this is compatible to IE7,IE6 do not support max-* is not considered.
2.
Resizing a window also enables you to implement a div horizontal vertical center Code instance:A div in the window to achieve the center effect, basically no difficulty, specifically, you can see the CSS implementation of the DIV
border (Boeder), you can define top, right, bottom, and left
Border= "3" cellspacing= "3" BORDER-WIDTH:3PX; With CSS, you can define a table's border as a uniform style, or you can define the color, size, and style of top, right, bottom and left borders, respectively.
You can use table, TD or th these selectors.
If you need to set no border effect, you can use the CSS definition: border-collapse:collapse;C
I. Line-height MethodIf only one or several lines of text are vertically centered, it is the easiest to create, as long as the line height of the text is the same as the height of the container. For example: P {Height: 30px; line-Height: 30px; width: 100px; overflow: hidden ;}This code can align the text vertically in a paragraph. Ii. padding methodAnother method is similar to the line height method. It is also suitable for vertical center of one or
The most common form of DIV+CSS Web page layout: Upper, middle left, middle right, bottom four modules, width 760px, the overall page center.
Structure code, top left right foot four modules are all independent and not nested.
The top is part of the general definition.
#top {height:100px; background: #ccc; width:760px; margin:auto; text-align:center;}
Met
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.