I have designed a responsive UI page using bootstrap, featuring a responsive image on the left side and text on the right side of the section.
Currently, the image appears on desktop but not on any mobile device when tested using developer tools.
Below is the code for the image that is not showing on mobile devices:
<img class="w-100 " src="<?php echo get_template_directory_uri(); ?>/images/tablesetting.jpg" alt="Thefirstpics">
For the complete code, refer to the following:
<!--About Dine section 1-->
<section class="about_sec_1 ">
<div class="container ">
<div class=" about_content">
<div class="left_img col col-lg-5">
<img class="w-100 " src="<?php echo get_template_directory_uri(); ?>/images/tablesetting.jpg" alt="Thefirstpics">
</div>
<div class="right_content col col-lg-6">
<div class="text-center">
<h1 class="pb-5"><?php echo esc_html(get_post_meta(get_the_ID(), 'about_title', true)); ?></h1>
<h4 class="pb-3"><?php echo esc_html(get_post_meta(get_the_ID(), 'about_subtitle', true)); ?> </h4>
</div>
<p class="about_para ">
The Catering was founded in blabla by Mr. Smith in lorem ipsum dolor sit amet, consectetur adipiscing elit
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
iruredolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.We only use
seasonal ingredients.
<p class="text-muted">
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
laborum consectetur adipiscing elit, sed do eiusmod temporincididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</p>
</p>
</div>
</div>
</div>
</section>
<!--end of About Dine section 1-->
The CSS code can be found below:
/* media querie for about dine section img*/
@media(max-width:575px) {
.left_img {
display:block;
}
}
.about_content,
.menu_content {
/*make two column content of menu and about section by using flexbox*/
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 3.5rem;
}
.about_para {
line-height: 30px;
}
Refer to the images of the section below:
https://i.sstatic.net/yryRxhB0.png
Here's how it looks on mobile: https://i.sstatic.net/QSIUiD2n.png