how to move the image and text left to right in SharePoint Form Header

IT Support 20 Reputation points
2023-08-03T14:22:06.61+00:00

here is the code of header I wanted to move image and text left to right but I don't know the code. please answer me enter image description here

{
    "elmType": "div",
    "style": {
        "border": "1px solid ",
        "padding": "10px"
    },
    "attributes": {
        "class": "sp-css-color-themePrimary sp-css-backgroundColor-themeLight"
    },
    "children": [
        {
            "elmType": "div",
            "txtContent": "=if(if(indexOf(toLocaleTimeString(@now)+';',';')==7,'0'+toLocaleTimeString(@now),toLocaleTimeString(@now))>'05:00:00' && if(indexOf(toLocaleTimeString(@now)+';',';')==7,'0'+toLocaleTimeString(@now),toLocaleTimeString(@now)) <'11:59:59' ,'Welcome To ATCN IT Helpdesk, ',if(if(indexOf(toLocaleTimeString(@now)+';',';')==7,'0'+toLocaleTimeString(@now),toLocaleTimeString(@now))>'12:00:00' && if(indexOf(toLocaleTimeString(@now)+';',';')==7,'0'+toLocaleTimeString(@now),toLocaleTimeString(@now))<'20:00:00' ,'Welcome To ATCN IT Helpdesk, ',if(if(indexOf(toLocaleTimeString(@now)+';',';')==7,'0'+toLocaleTimeString(@now),toLocaleTimeString(@now))>'20:00:00' ,'Welcome To ATCN IT Helpdesk ','')))",
            "attributes": {
                "class": "ms-fontSize-24 ms-fontWeight-semibold"
            }
        },
        {
            "elmType": "img",
            "style": {
                "border-radius": "50%"
            },
            "attributes": {
                "src": "=getUserImage(@me, 's')"
            }
        },
        {
            "elmType": "div",
            "style": {
                "border-radius": "50%",
                "padding": "0 5px"
            },
            "txtContent": "=substring(replaceAll(@me,'.',' '),0,indexOf(replaceAll(@me,'.',' '),'@'))",
            "attributes": {
                "class": "ms-fontSize-12 ms-fontWeight-semibold"
            }
        }
    ]
}
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,229 questions
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 31,566 Reputation points Microsoft External Staff
    2023-08-07T05:47:33.2233333+00:00

    Hi @IT Support ,

    Please try to change:

     {
                "elmType": "img",
                "style": {
                    "border-radius": "50%"
                },
    

    to:

     {
                "elmType": "img",
                "style": {
                    "padding-left": "300px"
                },
    

    And this is the result.

    08071

    Hope this is helpful. :-)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,566 Reputation points Microsoft External Staff
    2023-08-04T07:43:11.84+00:00

    Hi @IT Support ,

    You can try to use "padding-left" to make it:

    {
        "elmType": "div",
        "style": {
            "border": "1px solid ",
            "padding": "10px",
            "padding-left": "300px"
        },
    ……
    ……
    }
    

    08041


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.