braevin Posted June 2 Share Posted June 2 Hi there, I was able to embed images into my accordion dropdowns, however I'd like the images to be left aligned with the text wrapped around them (instead of the image on top of the text, like it is now). When I add a display:flex property, it makes the images all different sizes. site URL: https://www.couplesmarriageministry.org/resources/wives Any help is welcomed! LoftyDevs-Website-Designer 1 Link to comment
tuanphan Posted June 3 Share Posted June 3 Wrap like this? Lesum 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
LoftyDevs-Website-Designer Posted June 3 Share Posted June 3 Here is the full code .accordion-item__description:before{ content:" "; display:block; width:250px; height:120px; background-image:url(gus.jpg); background-size:contain; background-repeat:no-repeat; margin-right:15px } .accordion-item:nth-child(2) .accordion-item__description:before{ background-image: url(shawn.png)!important } .accordion-item:nth-child(3) .accordion-item__description:before{ content:none!important } .accordion-item__description{ display:flex!important } LoftyDevs - Squarespace Website Design Experts Connect - info@loftydevs.com Website - loftydevs.com Ahmedabad, India Link to comment
braevin Posted June 3 Author Share Posted June 3 @tuanphan Yes, like that! @LoftyDevs With that code, the images are different sizes. Link to comment
braevin Posted June 4 Author Share Posted June 4 @tuanphan I inputted part of that code, but the images are now all different sizes between the different accordion items. Link to comment
Solution tuanphan Posted June 6 Solution Share Posted June 6 Change this code #block-yui_3_17_2_1_1716759942208_4259 .accordion-item__description:before { content: " "; display: block; width: 900px !important; height: 200px; background-image: url(https://static1.squarespace.com/static/6403b613848fa226f7705708/t/665b9ba1087c235fa201c7ef/1717279663033/priscilla-du-preez-aPa843frIzI-unsplash+copy.jpg); background-size: contain; background-repeat: no-repeat; margin-bottom: 15px } to this #block-yui_3_17_2_1_1716759942208_4259 .accordion-item__description:before { content: " "; display: inline-block; width: 200px !important; float: left; margin-right: 10px; height: 200px; background-image: url(https://static1.squarespace.com/static/6403b613848fa226f7705708/t/665b9ba1087c235fa201c7ef/1717279663033/priscilla-du-preez-aPa843frIzI-unsplash+copy.jpg); background-size: contain; background-repeat: no-repeat; margin-bottom: 15px } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
braevin Posted June 6 Author Share Posted June 6 @tuanphan Solved! Brilliant, THANK YOU! Link to comment
braevin Posted July 2 Author Share Posted July 2 Reopening this topic because I'm having some errors with the code @tuanphan. Two of the blog posts have images that appear to be placed randomly (in the accordion drop downs). When I look at the code, the file names are accurate for which images should be showing, but different images appear. The "For Couples" post is perfect, but "For Husbands" and "For Wives" appears to be jumbled. Can you see if there's something in the code that's off? Post 1: https://www.couplesmarriageministry.org/resources/husbands Post 2: https://www.couplesmarriageministry.org/resources/wives This post has perfect images (filename and image match up): https://www.couplesmarriageministry.org/resources/couples Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment