Span set CSS style always does not work the solution

Source: Internet
Author: User

Span set CSS style does not work, there should be a lot of friends have seen it, small series have met today, after the search to sort out the experience is to let span into block-level elements to show that the CSS style will work

Copy Code code as follows:
<span id= ' span_slide_container ' style= ' display:block; Overflow-y: auto; Overflow-x: auto; height:500px; ' >


Here Display:block; Be sure to add, otherwise, span doesn't work

If you want to define span center, you must first show span as a block-level element, that is, to define the Display:block property of span first, and then add margin properties to span margin:0px auto; This will achieve the desired effect. Span is a lot of properties, almost all the properties of the tag can be defined in span, but many properties must be in the span of block-level elements in the role of the dish, span itself just to supplement the role of a tag, is a secondary tag, generally can only recognize the style of the text you deliberately, So if you want to define more of the other style attributes for the span label, you must first give the span a block-level attribute, and add the Display:block attribute so that your style will work later.

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.