/    Sign up×
Community /Pin to ProfileBookmark

How come my buttons don’t show as I would expect?

[upl-image-preview url=https://www.webdeveloper.com/forum/assets/files/2019-02-16/1550305402-567704-capture.png]

I’m trying to style a button in HTML/CSS but it seems that only the background will style. The button itself will only remain in the default setting. Does anyone know what I’ve done wrong?

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@cootheadFeb 16.2019 — Hi there me1986,

and a warm welcome to these forums. ?

You styled the parent element but not the child. ?

Play around with this code...

``<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: #444;
font: 100% / 162% BlinkMacSystemFont, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif;
color: #e8ddc9;
}

.buttonHolder {
padding: 1em;
border: 0.2em solid #4caf50;
background-color: #fff;
text-align: center;
}

.buttonHolder button {
display: inline-block;
padding: 1em 2em;
border: 0;
background-color: #4caf50;
font-size: 1em;
color: #fff;
}

&lt;/style&gt;

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

&lt;h1&gt;Hello&lt;/h1&gt;

&lt;div class="buttonHolder"&gt;
&lt;button&gt;Next&lt;/button&gt;
&lt;/div&gt;

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


_coothead_
Copy linkTweet thisAlerts:
@rootFeb 16.2019 — [[2,3,8],[2,8]]
Copy linkTweet thisAlerts:
@VITSUSAFeb 19.2019 — Click on mentioned hyperlink to create button according to yourself. here are multiple examples of to create button using html and CSS, which you can see -

https://www.w3schools.com/css/css3_buttons.asp
×

Success!

Help @me1986 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 4.20,
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,
)...