Tutorialspoint

What is a CSS Selector?

How to define selectors in CSS? What are the key selectors in CSS and what is its role?
mkotla
Answered on 8th May, 2018

The selectors in CSS are patterns to select the element to style.Let us see the key selectors in CSS:SelectorDemoDescription class.demoSelects all elements with class="demo"#id#myidSelects the element with id="myid"**Used to select all the elements

CSS Child Selector

What is the role of Child Selector in CSS? I want to set the following property to it ,
Chandu yadav
Answered on 8th May, 2018

Use the child selector, if you want to select all elements immediate children of a specified element.div > pYou can try to run the following code to implement CSS Child SelectorLive Demo<!DOCTYPE html> <html>    <head>       <style>          div > p {     ... Read More

CSS Descendant Selector

What is the role of Descendent Selector in CSS? I want to set the following property to it: ,
varun
Answered on 8th May, 2018

The descendant selector in CSS is used to match all elements that are descendants of a specified element.You can try to run the following code to implement CSS Descendent Selector:Live Demo<!DOCTYPE html> <html>    <head>       <style>          div p {         ... Read More

Center an element vertically in CSS

How can I center an element vertically in CSS? Which property or method should I use in CSS to achieve this?
Maheshwari Thakur
Answered on 8th May, 2018

To center an element vertically in CSS, use top and bottom padding.You can try to run the following code to center an elementLive Demo<!DOCTYPE html> <html>    <head>       <style>          .center {             padding: 50px 0;       ... Read More

Align elements using the CSS float property

With CSS, how can I align an element using the float property? I want the following div to be right aligned: ,
varma
Answered on 8th May, 2018

To align elements using the float property in CSS, you can try to run the following code:Live Demo<!DOCTYPE html> <html>    <head>       <style>          .demo {             float: right;             width: 200px;     ... Read More

CSS overflow-y

What is the role of overflow:y; property in CSS? How can I work with it correctly and what is its usage?
Prabhas
Answered on 8th May, 2018

The CSS overflow-y allows you to decide what to do with the top bottom edges of the content. You can try to run the following code to implement the overflow-y property:Live Demo<!DOCTYPE html> <html>    <head>       <style>          div {         ... Read More

CSS overflow-x

What is the role of overflow-x; property in CSS? How can I work with it correctly and what is its usage?
Chandu yadav
Answered on 8th May, 2018

The CSS overflow-x allows you to decide what to do with the left right edges of the content. You can try to run the following code to implement the overflow-x propertyLive Demo<!DOCTYPE html> <html>    <head>       <style>          div {         ... Read More

CSS overflow: auto

What is the role of overflow:auto; property in CSS? How can I work with it correctly and what is its usage?
seetha
Answered on 8th May, 2018

The CSS overflow: auto, adds a scrollbar only when it's needed, unlike overflow:scroll. You can try to run the following code to implement CSS overflow: auto property:Live Demo<!DOCTYPE html> <html>    <head>       <style>          div {             background-color: orange;   ... Read More

Style every <p> element that is the only child of its parent with CSS

How to style every <p> element that is the only child of its parent? Which selector is to be used in CSS to achieve this?
George John
Answered on 8th May, 2018

Use the CSS :only-child selector to style every <p> element that is the only child of its parent.You can try to run the following code to implement the :only-child selectorLive Demo<!DOCTYPE html> <html>    <head>       <style>          p:only-child {           ... Read More

CSS overflow: scroll

What is the role of overflow:scroll; property in CSS? How can I work with it correctly and what is its usage?
Sreemaha
Answered on 8th May, 2018

In the CSS overflow property with value scroll, the overflow is clipped and a scrollbar gets added. This allows the user to read the entire content.You can try to run the following code to implement CSS overflow: scroll property:Live Demo<!DOCTYPE html> <html>    <head>       <style>       ... Read More

Why we can't use arrow operator in gets and puts?

, With dot operator it's ok to use gets. e.g gets(s.name); but not with arrow operator please reply as soon as possible.
Pythonista
Answered on 8th May, 2018

You can't read user input in an un-initialized pointer. Instead, have a variable of the struct data type and assign its address to pointer before accessing its inner elements by -> operator#include <stdio.h> struct example { char name[20]; }; main() { struct example *ptr; struct example e; puts("enter name"); gets(e.name); ... Read More

CSS overflow: hidden

What is the role of overflow:hidden; property in CSS? How can I work with it correctly and what is its usage?
usharani
Answered on 8th May, 2018

In the CSS overflow property with value hidden, the overflow is clipped. The content hides. You can try to run the following code to implement CSS overflow: hidden property:Live Demo<!DOCTYPE html> <html>    <head>       <style>          div {             ... Read More

CSS overflow: visible

What is the role of overflow:visible; property in CSS? How can I work with it correctly and what is its usage?
Prabhas
Answered on 8th May, 2018

In the CSS overflow property with value visible, the overflow is not clipped. This is the default. You can try to run the following code to implement CSS overflow: visible property:Live Demo<!DOCTYPE html> <html>    <head>       <style>          div {         ... Read More

Extract decimal numbers from a string in Python

How to extract decimal numbers from a string in python and can u explain this in detail and i need a code for this??
Pythonista
Answered on 8th May, 2018

Using RegEx module is the fastest way.>>> import reAssuming that the string contains integer and floating point numbers as well as below:>>> s='my age is 25. I have 55.50 percent marks and 9764135408 is my number'the findall() function returns a list of numbers matching given pattern which includes digit before ... Read More

Center links in a Navigation Bar with CSS

How can I center the following links in a navigation bar ,
Ankith Reddy
Answered on 8th May, 2018

To center links in a navigation bar, you need to add ‘text-align: center’ to <li>Live Demo<!DOCTYPE html> <html>    <head>       <style>          ul {             list-style-type: none;             margin: 0;         ... Read More

Advertisements
Loading...
Unanswered Questions View All

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.