In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use css to make picture and text typesetting. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The basic process of html+css picture text typesetting.
Mainly use the CSS attribute visibility: hidden; to hide the p-label text, and then through the hover selector to change the height of the class card, the p-label text visibility: visible; is displayed.
1. First, html creates a new file and defines three div tags.
The first class party still remember, 2018, freshman semester, the beginning of our first class party Get together in the Beihai Garden Boyuan rockery, work together, together happy barbecue, although the dark can not see the fingers, frightening, but we get together, talking and laughing, know each other, but do not feel afraid, at that moment, as if time stopped Only happiness is left.
The excellent class evaluation still remembers that in the first semester of sophomore year One evening roll call counselor said that each class should take the most beautiful class photos and participate in the photography evaluation of the most beautiful class. we all thought together in the group, and everyone shared their good ideas and tried to take some of the most beautiful class photos. I'd love to say. We all look really handsome when we all give seriously.
I still remember the second semester of sophomore year. In order to complete the "most Beautiful North Sea" issued by the counselor, I volunteered for the North Sea. We all came to the beautiful beach park in Beihai and volunteered to pick up garbage and protect the beach. Seeing the person next to me raising his thumb, I felt it was worth it now.
2. The class of the div box is set to container, which can avoid the bottom misalignment in the floating layout.
3. Add style settings to container: display: flex elastic layout; align-items: center vertical axis alignment; justify-content: left axis left alignment.
.container {width: 100%; height: 500px; padding: 0px 40px; display: flex; align-items: center; justify-content: left }
Code effect
4. Add style settings to card: transition attribute mouse hover; box-shadow set shadow effect; background color of background-color attribute element.
Card {height: 270px; max-width: 350px; margin: 0px 20px; background-color: white; transition: 0.4s Box-shadow: 2px 2px 5px rgba (0. 0. 0. 0. 2);}
5. Select the mouse movement style for the hover selector.
.card: hover {height:400px; box-shadow:5px 5px 10px rgba (0memo 0penol 0.2a);}
6. Use the img tag to deal with the size, width and height of the picture, and object-fit: cover to cut the picture and retain the original scale of the picture.
.card .img {height: 200px; width: 100%;} .card .img img {height: 100%; width: 100% Object-fit: cover;}
7. Visibility: hidden; hides the p label text and adds transition attributes to hover.
.card. Bottom-text {text-indent: 2em; padding: 0 20px 10px 20px; margin-top: 5px; background-color: white; visibility: hidden Transition: 0.5s
8. Hover selector to change the height of the class card to display the p-label text visibility: visible;.
.card: hover. Bottom-text {opacity: 1; visibility: visible
Ok, complete!
Complete code
CSS image text typesetting .container {width: 100%; height: 500px; padding: 0px 40px; display: flex Align-items: center; justify-content: left;} .card {height: 270px; max-width: 350px Margin: 0px 20px; background-color: white; transition: 0.4s; box-shadow: 2px 2px 5px rgba Hover {height:400px; box-shadow:5px 5px 10px rgba;} .card. IMG {height: 200px Width: 100%;} .card .IMG img {height: 100%; width: 100%; object-fit: cover } .card. Top-text {padding-top: 5px;} .card. Top-text .name {font-size: 25px; font-weight:600 Color: # 202020;} .card. Top-text p {font-size: 20px; font-weight:600; color: # e74c3c Line-height: 20px;} .card. Bottom-text {text-indent: 2em; padding: 0 20px 10px 20px; margin-top: 5px Background-color: white; visibility: hidden; transition: 0.5s;} .card: hover. Bottom-text {opacity: 1 Visibility: visible;} .card. Bottom-text .text {text-align: justify;}
The first class party still remember, 2018, freshman semester, the beginning of our first class party Get together in the Beihai Garden Boyuan rockery, work together, together happy barbecue, although the dark can not see the fingers, frightening, but we get together, talking and laughing, know each other, but do not feel afraid, at that moment, as if time stopped Only happiness is left.
The excellent class evaluation still remembers that in the first semester of sophomore year One evening roll call counselor said that each class should take the most beautiful class photos and participate in the photography evaluation of the most beautiful class. we all thought together in the group, and everyone shared their good ideas and tried to take some of the most beautiful class photos. I'd love to say. We all look really handsome when we all give seriously.
I still remember the second semester of sophomore year. In order to complete the "most Beautiful North Sea" issued by the counselor, I volunteered for the North Sea. We all came to the beautiful beach park in Beihai and volunteered to pick up garbage and protect the beach. Seeing the person next to me raising his thumb, I felt it was worth it now. This is the end of this article on "how to use css to make picture and text typesetting". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.