📜  基础 CSS 浮点类

📅  最后修改于: 2022-05-13 01:56:31.631000             🧑  作者: Mango

基础 CSS 浮点类

Foundation CSS 是由 ZURB 基金会于 2011 年 9 月构建的开源和响应式前端框架,可以轻松设计美观的响应式网站、应用程序和电子邮件,这些网站、应用程序和电子邮件看起来很棒并且可以在任何设备上访问。它被许多公司使用,例如 Facebook、eBay、Mozilla、Adobe,甚至迪士尼。该框架建立在类似 Saas 的引导程序上。它更加复杂、灵活且易于定制。它还带有 CLI,因此很容易与模块捆绑器一起使用。它提供了 Fastclick.js 工具,用于在移动设备上更快地呈现。

float 类将元素从页面的正常流程中移除,并将其放置在其父元素的特定一侧,从而使其他元素环绕它。

基础 CSS 浮点类:

  • float-left:该类将元素从网页的正常流程中移除,使其浮动在容器的内部左侧。
  • float-right:该类将元素从网页的正常流程中移除,并使其浮动在容器的内部右侧。
  • float-center:此类使边距值自动,从而使元素居中。

句法:

....

示例 1:以下代码演示了float-left类。

HTML


 

    
    
    
     
    Float Classes

 

    

GeeksforGeeks

     Foundation CSS Float Classes     
        
             float-left class         
        
            Greetings to all the Geeks out there! We welcome             you to the platform where we consistently strive             to offer the best of education. This platform has             been designed for every geeks wishing to expand             knowledge, share their knowledge and is ready to             grab their dream job. We have millions of articles,             live as well as online courses, thousands of tutorials             and much more just for the geek inside you. Thank you             for choosing and supporting us!         
    


HTML


 

    
    
    
    
     
    Float Classes

 

    

GeeksforGeeks

     Foundation CSS Float Classes     
        
             float-right class         
        
            Greetings to all the Geeks out there! We welcome             you to the platform where we consistently strive             to offer the best of education. This platform has             been designed for every geeks wishing to expand             knowledge, share their knowledge and is ready to             grab their dream job. We have millions of articles,             live as well as online courses, thousands of tutorials             and much more just for the geek inside you. Thank you             for choosing and supporting us!         
    


HTML


 

    
    
    
    
     
    Float Classes

 

    

GeeksforGeeks

     Foundation CSS Float Classes     
        
             float-center class         
        
            Greetings to all the Geeks out there! We welcome             you to the platform where we consistently strive             to offer the best of education. This platform has             been designed for every geeks wishing to expand             knowledge, share their knowledge and is ready to             grab their dream job. We have millions of articles,             live as well as online courses, thousands of tutorials             and much more just for the geek inside you. Thank you             for choosing and supporting us!         
    


输出:

基础 CSS 浮点类

基础 CSS 浮点类

示例 2:以下代码演示了float-right类。

HTML



 

    
    
    
    
     
    Float Classes

 

    

GeeksforGeeks

     Foundation CSS Float Classes     
        
             float-right class         
        
            Greetings to all the Geeks out there! We welcome             you to the platform where we consistently strive             to offer the best of education. This platform has             been designed for every geeks wishing to expand             knowledge, share their knowledge and is ready to             grab their dream job. We have millions of articles,             live as well as online courses, thousands of tutorials             and much more just for the geek inside you. Thank you             for choosing and supporting us!         
    

输出:

基础 CSS 浮点类

基础 CSS 浮点类

示例 3:以下代码演示了float-center类。

HTML



 

    
    
    
    
     
    Float Classes

 

    

GeeksforGeeks

     Foundation CSS Float Classes     
        
             float-center class         
        
            Greetings to all the Geeks out there! We welcome             you to the platform where we consistently strive             to offer the best of education. This platform has             been designed for every geeks wishing to expand             knowledge, share their knowledge and is ready to             grab their dream job. We have millions of articles,             live as well as online courses, thousands of tutorials             and much more just for the geek inside you. Thank you             for choosing and supporting us!         
    

输出:

基础 CSS 浮点类

基础 CSS 浮点类

参考链接: https://get.foundation/sites/docs/float-classes.html