/    Sign up×
Community /Pin to ProfileBookmark

How to create centered text in the middle of an image

Hello. I am sending a link leading to a photo of what I intend to code. Could you please help by sending a link to a website that explains how to do that? Thank you.

https://ibb.co/Lgs62R1

to post a comment
CSSHTML

3 Comments(s)

Copy linkTweet thisAlerts:
@cootheadMay 10.2020 — Hi there @codewitch,

here is a basic example...

``<i>
</i>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en"&gt;
&lt;head&gt;

&lt;meta charset="utf-8"&gt;
&lt;meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"&gt;

&lt;title&gt;untitled document&lt;/title&gt;

&lt;!--&lt;link rel="stylesheet" href="screen.css" media="screen"&gt;--&gt;

&lt;style media="screen"&gt;

body {
background-color: #f0f0f0;
font: normal 1em / 150% sans-serif;
}

#container {
display:flex;
justify-content: center;
align-items: center;
width: 62vw;
height: 34.87vw;
padding: 1em;
margin: auto;
border: 1px solid #666;
box-sizing: border-box;
box-shadow: 0.75vw 0.75vw 0.75vw rgba(0, 0, 0, 0.5 );
background-color: #000;
background-image: url( https://i.picsum.photos/id/184/992/558.jpg );
background-size: 100% auto;
}

h1 {
color: #fff;
text-transform: capitalize;
text-align: center;
}

&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;div id="container"&gt;
&lt;h1&gt;Lorem Ipsum&lt;/h1&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;<i>
</i>
``


_coothead_
Copy linkTweet thisAlerts:
@siddhi_patelMay 11.2020 — hello..

Try below example

``<i>
</i>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;untitled document&lt;/title&gt;
&lt;style&gt;
#container {
display:flex;
justify-content: center;
align-items: center;
padding: 1em;
margin: auto;
background-image: url(WRITE URL HEAR);
background-size: 100% auto;
}
h1 {
text-align: center;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="container"&gt;
&lt;h1&gt;TEXT HEAR&lt;/h1&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;<i>
</i>
``
Copy linkTweet thisAlerts:
@cootheadMay 11.2020 — @siddhi_patel#1618309;

I see that, in your infinite wisdom, you have

decided to fcuk around with the code that I

posted.

I would humbly suggest that you test the

results of your unwarranted interference,

to see how it compares to the example...

https://ibb.co/Lgs62R1

...which the O.P. gave us.

I did ask the powers that be to remove

your nonsensical post, but it appears

that they have chosen to ignore my

request.

_coothead_
×

Success!

Help @codewitch spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...