To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.
You can apply a background color to the html element, and then apply a background-image to the body element and use the background-size property to set it to 50% of the page width. This results in a similar effect, though would really only be used over gradients if you happen to be using an image or two.
I am trying to create a bottom bar with the background like this :
I am currently using the following code :
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient android:endColor="#000000" android:startColor="#696969"
android:centerColor="#696969" android:angle="270" />
<stroke android:color="#696969" />
<padding android:left="2dp" android:top="3dp" android:right="2dp"
android:bottom="3dp" />
</shape>
</item>
</selector>
But the output looks like this ... :
How to get this ,two colored background ? Please suggest.. Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With