I personally like Microsoft's new generation of products very much. Regardless of whether the product is mature or not, it brings brand-new products. The so-called brand new refers to the user experience. Apple’s success in recent years has caused all products to imitate its interface, including Android. I don’t know how you feel. Anyway, I am tired of these rounded rectangles ( Fans of Apple and Android, please don’t complain, this is just an evaluation of the interface. In fact, overall, Microsoft still has a gap). The launch of wp made my eyes shine, and I immediately fell in love with Metro-style products. Today wp8 and win8 are starting to become more and more mature.
If the writing is not good, you are welcome to correct and criticize me, but you are not welcome to criticize me for no reason. God, please take a detour.
Stop talking nonsense and get to the point. The basic idea is: Define an outer div with a fixed height (such as 180px in this example) and set the attribute overflow:hidden (hide the part beyond the border), and then in this div Define an inner div inside and set the attribute position:relative (relative layout). In this inner div, we define a picture, and be careful to set its height to be the same as the height of the outer div (such as 180px in this example), and then define a div to put text. The height of this div is also the same as the height of the outer div. The height is the same (such as 180px in this example, if you give a padding, the height will be reduced accordingly to achieve a height of 180px for the entire div). The layout code is as follows
html:
Copy code