To add two strings we need a '+' operator to create some space between the strings, but when the first string itself has a space with in it, there is no need to assign space explicitly. In the following example since the string 'str1' has a space with in it, just only concatenation without space is adequate to add both the strings.ExampleLive Demo function str(str1, str2) { return (str1 + str2); } document.write(str("tutorix is the best ", "e-learning platform")); Outputtutorix is the best ... Read More
The multi-column rule-width property is used to specify the column width. You can try to run the following code to implement rule-width property using CSS:ExampleLive Demo .multi { /* Column count property */ -webkit-column-count: 4; -moz-column-count: 4; column-count: 4; /* Column gap property */ -webkit-column-gap: 40px; ... Read More
We will face two cases while calling the parent constructor method in child class.Case1We can't run directly the parent class constructor in child class if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required.Example Live DemoOutput: I am in Tutorials Point I am not in Tutorials PointExplanationIn the above example, we have used parent::__construct() to call the parent class constructor.Case2If the child does not define a constructor then it may be inherited from the parent class just like a normal class method(if it was not declared as ... Read More
To convert the XML document into PHP array, we have to utilize some PHP functions. The procedure is explained underneath with an example.Step 1We have to create an XML file that needs to convert into the array.abc.xml AL A SA S Step 2The above XML file will import into PHP using file_get_contents() function which read the entire file as a string and stores into a variable.Step 3After the above step, we ... Read More
CSS3 added shadow effects to text, with the text-shadow property. You can try to implement the following code to add text shadow −ExampleLive Demo h1 { text-shadow: 2px 2px; } h2 { text-shadow: 2px 2px red; } h3 { text-shadow: 2px 2px 5px red; } h4 { color: white; text-shadow: 2px 2px 4px #000000; } h5 { text-shadow: 0 0 3px #FF0000; } h6 { text-shadow: 0 0 3px #FF0000, 0 0 5px #0000FF; } p { color: white; text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue; } Welcome to my website! Welcome to my website! Welcome to my website! Welcome to my website! Welcome to my website! Welcome to my website! Welcome to my website! Output
Gradients display the combination of two or more colors.The following are the types of gradients:Types of gradientsLinear Gradients(down/up/left/right/diagonally)Radial GradientsExampleLet us see an example of radial gradients:Live Demo #grad1 { height: 100px; width: 550px; background: -webkit-radial-gradient(red 5%, green 15%, pink 60%); background: -o-radial-gradient(red 5%, green 15%, pink 60%); background: -moz-radial-gradient(red 5%, green 15%, pink 60%); background: radial-gradient(red 5%, green 15%, pink 60%); }
You can try to run the following code to implement left to right gradient in CSS3ExampleLive Demo #grad1 { height: 100px; background: -webkit-linear-gradient(left, red , blue); background: -o-linear-gradient(right, red, blue); background: -moz-linear-gradient(right, red, blue); background: linear-gradient(to right, red , blue); }
Linear gradients are used to arrange two or more colors in linear formats.ExampleYou can try to run the following code to implement linear gradients in CSS3 −Live Demo #grad1 { height: 100px; background: -webkit-linear-gradient(pink,green); background: -o-linear-gradient(pink,green); background: -moz-linear-gradient(pink,green); background: linear-gradient(pink,green); } Output
You can try to run the following code to implement multi-color gradients in CSS3 −ExampleLive Demo #grad2 { height: 100px; background: -webkit-linear-gradient(red, orange, yellow, red, blue, green,pink); background: -o-linear-gradient(red, orange, yellow, red, blue, green,pink); background: -moz-linear-gradient(red, orange, yellow, red, blue, green,pink); background: linear-gradient(red, orange, yellow, red, blue, green,pink); }
HSL stands for hue, saturation, lightness. Here, Huge is a degree of the color wheel, saturation and lightness are percentage values between 0 to 100%. ExampleThe following example shows HSL color property:Live Demo #g1 {background-color:hsl(120, 100%, 50%);} #g2 {background-color:hsl(120,100%,75%);} #g3 {background-color:hsl(120,100%,25%);} HSL colors: Green Normal Green Dark Green