Encircle the words with imagery

I want to design a layout where an icon floats beside some text, just like how an image would align within a block of text. The text should wrap around the icon smoothly, and if it goes onto a new line, it should start directly below the first line of text instead of next to the icon.

Here is my desired outcome: https://i.sstatic.net/Sq0MB.png

However, this is what I currently have: https://i.sstatic.net/tD27J.png

Below is the code snippet I am using:

<div style={{width:"100%"}}>
  <IconButtonMUI
    onClick={() => {
      window.open(url, '_blank');
    }}
    size='small'
    style={{float:"left"}}
  >
    <Iconify
      width={16}
      icon="solar:map-arrow-up-bold"
    />
  </IconButtonMUI>
  <Stack
    direction="row"
    alignItems="center"
    style={{float:"none", textAlign: 'justify'}}
    sx={{
      typography: 'h6',
    }}
  >
    {marker.placeName}
  </Stack>
</div>

Thank you in advance!

Answer №1

Eliminate the current style from both <IconButtonMUI /> and <Stack />.

Simply include style={{display: 'inline'}} on the <Stack /> component.

View the demonstration on CodeSandbox

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What do the different colored highlights in Sublime Text 2 indicate?

I am facing an issue with the code in a particular file: background: -moz-linear-gradient(red, orange, yellow, green, blue, indigo, violet); Interestingly, Sublime Text 2 appears to highlight the background of indigo and violet with a light blue color: ...

What is the purpose of the property "fitInto" in a paper-dialog

Hey there, I'm new to Polymer and I've been trying to customize a dialog to fit it into a div so it behaves like a popover. I attempted the following code: <paper-dialog fitInto="{{body}}"> <h2>Header</h2> <paper-di ...

Different approach to handling overflow without using the hidden property in CSS

Having trouble with my CSS layout I've created a form within a fixed 500 pixel width div that is centered on the page using margin auto; To create a table-like structure within the div, I used div elements as rows. Due to varying heights of these ro ...

The Form button in my PHP email code is failing to produce any output when submitted

I attempted to create a contact form using a combination of HTML and PHP. Everything was functioning as expected during testing with the code input type="submit" name="submit" value="Submit" However, when I switched to using div and button with the class ...

Conceal/Reveal Content with React Native

My file, test.js, contains two Classes - A and B. Inside Class B, there is a button labeled hide view. I am looking for a way to toggle (show/hide) the view of Class A without reloading the page when the hide view button is clicked. Any suggestions on ho ...

Div elements containing identical content and styled in the same manner exhibit distinct dashed borders

After designing a pen with a unique twist, you'll notice that the first div has a border-bottom, while the second has a border-top. What's interesting is that the border on the second div is not the same as the first. Visit this link to see for ...

Guide to displaying highcharts using external json data for numerous series

Having an issue with using angularjs and highcharts with multiple series where the data is coming from an external JSON file. When trying to access the data with a for loop using data.data[i].data, it's not working properly. Can anyone offer assistanc ...

Is it true that the npm vulnerability in Prototype Pollution cannot be resolved?

Just starting a new project with React, and after installing the basic package (npx create-react-app), I ran an audit and found a low vulnerability: === npm audit security report === ...

To enhance VS IntelliSense and type checking in react-intl's FormattedMessage component, assign an id that aligns with a custom TypeScript interface

Due to the limitations of react-localization in terms of date and number formats, as well as its heavy reliance on a single developer, our team made the decision to transition to react-intl for a more stable long-term solution. Check out the contributors ...

Iconic Side Navigation with collapsed button malfunctioning due to negative positioning

I'm facing two issues with my webpage. First: I have three buttons on the right side of my page that are supposed to behave like the buttons on this example. However, when you scroll, you can see that their position is incorrectly displayed "outside" ...

Struggling to make the DataTables.net Bootstrap 5 example function properly

I'm currently working on familiarizing myself with the styling example for Datatables.net using Bootstrap 5, which can be found at https://datatables.net/examples/styling/bootstrap5.html. I've followed the code provided in the example closely, bu ...

Guide on adding SSI comments within a Gatsby project

I am in the process of developing a Gatsby application and I am facing a challenge with inserting SSI lines that are styled as HTML comments. For example: <!--#set var="section" value="#{section}"--> <!--#include virtual="/virtual/3.0/script-app. ...

Tablet-friendly dropdown menu

Seeking advice on implementing @media queries for tablets with a width of 991px. Currently, the CSS file is optimized for mobile devices but needs adjustments for tablet responsiveness in the dropdown menu. I attempted the following CSS code: @media (max ...

Is there a way to ensure that the text stays positioned behind the initial image even as the window size is adjusted

<html> <head> <title> Example </title> <style> img:hover {opacity : 0.3;} img {z-index : 1; height : 33%; width : 33%; } .first { position : absolute; top: 0%; left: 0%;} .second {position : absolute; top: 0%; left: 33%; ...

Implementing jQuery slideDown effect on a nested table element

I am facing an issue where the nested table does not slide down from the top as intended when a user clicks the "Show" button. Despite setting the animation duration to 500ms with jQuery's slideDown() function, the table instantly appears. I am using ...

Is the :root selector truly devoid of value?

While I understand that :root can be used to select the html tag in an HTML file and the svg tag in an SVG file, I personally find it strange and not practical to apply the same styles to both HTML and SVG using :root. It seems like an unrealistic scenario ...

Modifying the background hue of the element-ui tooltip

I am currently working with vue.js version 2.6.10 and element-ui version 2.15.1. The element-ui component I am using is as follows: <el-tooltip content="Top center" placement="top"> <span>Dark</span> ...

What is the best way to align the navbar-brand to the right using Bootstrap 4?

I am working with Bootstrap 4 and I have a specific requirement for the navbar-brand item to be positioned on the far right side. By default, the menu appears on the left side. I have attempted to use classes like ml-auto, mx-auto, mr-auto, pull-right, bu ...

Issue with React: Caret icon in dropdown menu shifts position when page is resized to iPad or smaller dimensions

I'm facing an issue with a styled react component that has a custom dropdown menu featuring a caret icon. Whenever I test the responsiveness of the dropdown, the caret icon ends up outside the intended area. To resolve this, I've wrapped the drop ...

Prevent image element from overflowing in HTML

How can I prevent the images on the right from extending beyond the right padding? I want the fourth image to align with the red block above it. https://i.sstatic.net/KUE62.png Does that clarify things? <div style="margin: 0 15px;height: 40px; back ...