Apply HTML tags in Mobile View
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2023 12:50 AM
I made HTML field in catalog item. I want to make that field shows as same as Desktop View in Mobile.
If user made table in HTML field, it will shows table instead of <td> or <tr>.
How can i do for that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2023 01:54 AM
HI @Jaeik Lee ,
I trust you are doing great.
Here's an approach you can follow:
Wrap the HTML field content within a container element, such as a <div>.
Apply CSS styles to the container element to control its appearance and behavior on mobile devices. You can use media queries to target specific screen sizes and apply different styles accordingly.
Use CSS properties like overflow-x: auto; to allow horizontal scrolling if the content exceeds the screen width.
Ensure that the HTML field content is responsive and adjusts its layout to fit smaller screen sizes. You can use CSS frameworks like Bootstrap or Flexbox to achieve this easily.
Here's an example code snippet to illustrate the approach:
<style>
.html-field-container {
/* Define styles for the container element */
/* Adjust the following styles to fit your requirements */
overflow-x: auto;
max-width: 100%;
white-space: nowrap;
}
/* Apply specific styles for smaller screens */
@media (max-width: 768px) {
.html-field-container {
/* Adjust the following styles to fit your requirements */
/* Example styles to make the content more readable on mobile */
font-size: 14px;
line-height: 1.5;
}
}
</style>
<!-- Wrap the HTML field content within the container -->
<div class="html-field-container">
<!-- The HTML field content goes here -->
<!-- Add your HTML content within this div
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2023 02:07 AM
It did not work in Now Mobile. It still shows html codes.