Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Tuesday, September 20, 2016

cell border yes or no



table, th, td {
  /*border: 1px solid black;*/
    text-align: center;
    /*border-bottom: 1px solid black;*/
   
}

.bottomBorder{
    border-bottom: 1px solid black;
    border-bottom-width: 1px;
    border: 0px;
}

.topBorder {
    border-top: 1px solid black !important;
    border-top-width: 1px;
    /*border: 0px;*/
}

.rightBorder {
    border-right: 1px solid black !important;
    border-right-width: 1px;
}

.leftBorder {
    border-left: 1px solid black !important;
    border-left-width: 1px;
}

.allBorder{
    border:1px solid black !important;
}
.noTopBorder{
    border-bottom-width: 0px;
   
}

.noBottomBorder{
    border-bottom-width:  0px;
    border-bottom: 0px !important;
}
.StandardTable {
  color:#222222 !important;
  border: 1px solid;
  /*border: 1px solid #656565;*/
  /*-moz-border-radius: 10px;*/
  /*-webkit-border-radius: 10px;*/
  /*margin-left: auto;*/
  /*margin-right: auto;*/
  /*box-shadow: 10px 10px 5px #888888;*/
  width: 90%;
  margin-left: 20px;
  margin-bottom: 15px;
  border-spacing: 0;
   
}


<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta charset="utf-8" />
    <link href="keyword.css" rel="stylesheet" />
</head>

<body>
    <div class="content viewing profileBox second" id="cfaesW_admin_ISSUE_area" ng-if="status=='cISSUE'">
        <table ng-show="arrISSUE.length > 0" class="StandardTable">
            <col>
                <colgroup span="2"></colgroup>
                <colgroup span="2"></colgroup>
                <tr>
                    <td></td>
                    <td></td>
                    <td>visiblity</td>
                </tr>
                <tr>
                    <td></td>
                    <td class="no"></td>
                    <td>(active</td>
                </tr>

                <tr>
                    <td></td>
                    <td class="topBorder rightBorder leftBorder">impact araa</td>
                    <td>inactive)</td>
                </tr>
        </table>
    </div>

</body>

</html>

CSS table

https://css-tricks.com/complete-guide-table-element/

table {
  border-collapse: collapse;
}

td, th {
  border: 1px solid #999;
  padding: 0.5rem;
  text-align: left;
}

<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>ID</th>
      <th>Favorite Color</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Jim</td>
      <td>00001</td>
      <td>Blue</td>
    </tr>
    <tr>
      <td>Sue</td>
      <td>00002</td>
      <td>Red</td>
    </tr>
    <tr>
      <td>Barb</td>
      <td>00003</td>
      <td>Green</td>
    </tr>
  </tbody>
</table>

Wednesday, July 13, 2016

box in a box with dynamic content



  • The container must have display:table
  • The boxes inside container must be: display:table-cell
  • Don't put floats.

flex-container



<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
body {
  margin: 0;
}

.flex-container {
  display: flex;
  flex-direction: column;
  min-height: 40vh;
}

header {
  background-color: #3F51B5;
  color: #fff;
}

section.content {
  flex: 1;
}

footer {
  background-color: #FFC107;
  color: #333;
}
</style>
</head>

<body>
<div class="flex-container">
  <header>
    <h1>
     Header  
    </h1>
  </header>

  <section class="content">
    Content
  </section>

  <footer>
    <h4>
      Footer
    </h4>
  </footer>
</div>
</body>
</html>

Monday, July 11, 2016

margin background

margin background inherited from parent

so use border to show color

.widget-cfaesProfile .first {
  width: 100%;
  height: 1950px;
  background: white;
  position: relative;
  border-color: white;
  border-width : 20px;
  border-style: solid;

}

Friday, July 8, 2016

Uniquely Positioning Elements

http://learn.shayhowe.com/html-css/positioning-content/

Uniquely Positioning Elements

Every now and then we’ll want to precisely position an element, but floats or inline-block elements won’t do the trick. Floats, which remove an element from the flow of a page, often produce unwanted results as surrounding elements flow around the floated element. Inline-block elements, unless we’re creating columns, can be fairly awkward to get into the proper position. For these situations we can use the position property in connection with box offset properties.
The position property identifies how an element is positioned on a page and whether or not it will appear within the normal flow of a document. This is used in conjunction with the box offset properties—toprightbottom, and left—which identify exactlywhere an element will be positioned by moving elements in a number of different directions.
By default every element has a position value of static, which means that it exists in the normal flow of a document and it doesn’t accept any box offset properties. Thestatic value is most commonly overwritten with a relative or absolute value, which we’ll examine next.

Relative Positioning

The relative value for the position property allows elements to appear within the normal flow a page, leaving space for an element as intended while not allowing other elements to flow around it; however, it also allows an element’s display position to be modified with the box offset properties. For example, consider the following HTML and CSS:
HTML
1
2
3
4
<div>...</div>
<div class="offset">...</div>
<div>...</div>
CSS
1
2
3
4
5
6
7
8
9
10
div {
  height: 100px;
  width: 100px;
}
.offset {
  left: 20px;
  position: relative;
  top: 20px;
}

Relative Positioning Demo

Here the second <div> element, the element with the class of offset, has a positionvalue of relative and two box offset properties, left and top. This preserves the original position of the element, and other elements are not allowed to move into this space. Additionally, the box offset properties reposition the element, pushing it 20pixels from the left and 20 pixels from the top of its original location.
With relatively positioned elements, it’s important to know that the box offset properties identify where an element will be moved from given its original position. Thus, the left property with a value of 20 pixels will actually push the element towards the right, from the left, 20 pixels. The top property with a value of 20 pixels, then, will push an element towards the bottom, from the top, 20 pixels.
When we position the element using the box offset properties, the element overlaps the element below it rather than moving that element down as the margin or paddingproperties would.

Absolute Positioning

The absolute value for the position property is different from the relative value in that an element with a position value of absolute will not appear within the normal flow of a document, and the original space and position of the absolutely positioned element will not be preserved.
Additionally, absolutely positioned elements are moved in relation to their closest relatively positioned parent element. Should a relatively positioned parent element not exist, the absolutely positioned element will be positioned in relation to the <body>element. That’s quite a bit of information; let’s take a look at how this works inside some code:
HTML
1
2
3
4
<section>
  <div class="offset">...</div>
</section>
CSS
1
2
3
4
5
6
7
8
9
section {
  position: relative;
}
div {
  position: absolute;
  right: 20px;
  top: 20px;
}

Absolute Positioning Demo

In this example the <section> element is relatively positioned but doesn’t include any box offset properties. Consequently its position doesn’t change. The <div> element with a class of offset includes a position value of absolute. Because the<section> element is the closest relatively positioned parent element to the <div>element, the <div> element will be positioned in relation to the <section> element.
With relatively positioned elements, the box offset properties identify in which direction an element would be moved in relation to itself. With absolutely positioned elements, the box offset properties identify in which direction an element will be moved in relation to its closest relatively positioned parent element.
As a result of the right and top box offset properties, the <div> element will appear20 pixels from the right and 20 pixels from the top of the <section>.
Because the <div> element is absolutely positioned, it does not sit within the normal flow of the page and will overlap any surrounding elements. Additionally, the original position of the <div> is not preserved, and other elements are able to occupy that space.
Typically, most positioning can be handled without the use of the position property and box offset properties, but in certain cases they can be extremely helpful.

Containing Floats

http://learn.shayhowe.com/html-css/positioning-content/

Containing Floats

Rather than clearing floats, another option is to contain the floats. The outcomes of containing floats versus those of clearing them are nearly the same; however, containing floats does help to ensure that all of our styles will be rendered properly.
To contain floats, the floated elements must reside within a parent element. The parent element will act as a container, leaving the flow of the document completely normal outside of it. The CSS for that parent element, represented by the group class below, is shown here:
1
2
3
4
5
6
7
8
9
10
11
12
13
.group:before,
.group:after {
  content: "";
  display: table;
}
.group:after {
  clear: both;
}
.group {
  clear: both;
  *zoom: 1;
}
There’s quite a bit going on here, but essentially what the CSS is doing is clearing any floated elements within the element with the class of group and returning the flow of the document back to normal.
More specifically, the :before and :after pseudo-elements, as mentioned in the Lesson 4 exercise, are dynamically generated elements above and below the element with the class of group. Those elements do not include any content and are displayed as table-level elements, much like block-level elements. The dynamically generated element after the element with the class of group is clearing the floats within the element with the class of group, much like the clear from before. And lastly, the element with the class of group itself also clears any floats that may appear above it, in case a left or right float may exist. It also includes a little trickery to get older browsers to play nicely.
It is more code than the clear: both; declaration alone, but it can prove to be quite useful.
Looking at our two-column page layout from before, we could wrap the <section> and<aside> elements with a parent element. That parent element then needs to contain the floats within itself. The code would look like this:
HTML
1
2
3
4
5
6
7
<header>...</header>
<div class="group">
  <section>...</section>
  <aside>...</aside>
</div>
<footer>...</footer>
CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.group:before,
.group:after {
  content: "";
  display: table;
}
.group:after {
  clear: both;
}
.group {
  clear: both;
  *zoom: 1;
}
section {
  float: left;
  margin: 0 1.5%;
  width: 63%;
}
aside {
  float: right;
  margin: 0 1.5%;
  width: 30%;
}

Layout with Contained Floats Demo

The technique shown here for containing elements is know as a “clearfix” and can often be found in other websites with the class name of clearfix or cf. We’ve chosen to use the class name of group, though, as it is representing a group of elements, and better expresses the content.
As elements are floated, it is important to keep note of how they affect the flow of a page and to make sure the flow of a page is reset by either clearing or containing the floats as necessary. Failing to keep track of floats can cause quite a few headaches, especially as pages begin to have multiple rows of multiple columns.

clear float



Clearing & Containing Floats

The float property was originally designed to allow content to wrap around images. An image could be floated, and all of the content surrounding that image could then naturally flow around it. Although this works great for images, the float property was never actually intended to be used for layout and positioning purposes, and thus it comes with a few pitfalls.
One of those pitfalls is that occasionally the proper styles will not render on an element that it is sitting next to or is a parent element of a floated element. When an element is floated, it is taken out of the normal flow of the page, and, as a result, the styles of elements around that floated element can be negatively impacted.
Often margin and padding property values aren’t interpreted correctly, causing them to blend into the floated element; other properties can be affected, too.
Another pitfall is that sometimes unwanted content begins to wrap around a floated element. Removing an element from the flow of the document allows all the elements around the floated element to wrap and consume any available space around the floated element, which is often undesired.
With our previous two-column example, after we floated the <section> and <aside>elements, and before we set a width property value on either of them, the content within the <footer> element would have wrapped in between the two floated elements above it, filling in any available space. Consequently, the <footer> element would have sat in the gutter between the <section> and <aside> elements, consuming the available space.

Layout without Cleared or Contained Floats Demo

To prevent content from wrapping around floated elements, we need to clear, or contain, those floats and return the page to its normal flow. We’ll proceed by looking at how to clear floats, and then we’ll take a look at how to contain floats.

Clearing Floats

Clearing floats is accomplished using the clear property, which accepts a few different values: the most commonly used values being leftright, and both.
1
2
3
4
div {
  clear: left;
}
The left value will clear left floats, while the right value will clear right floats. Theboth value, however, will clear both left and right floats and is often the most ideal value.
Going back to our previous example, if we use the clear property with the value ofboth on the <footer> element, we are able to clear the floats. It is important that this clear be applied to an element appearing after the floated elements, not before, to return the page to its normal flow.
1
2
3
4
footer {
  clear: both;
}

Layout with Cleared Floats Demo

Containing Floats

The Universal Selector

http://learn.shayhowe.com/html-css/opening-the-box-model/

The Universal Selector

In the first step of this exercise we were introduced to the universal selector. In CSS the asterisk, *, is the universal selector, which selects every element. Rather than listing every single element imaginable, we can use the asterisk as a catch-all to select all elements for us.
The :before and :after pseudo-elements also mentioned in this step are elements that can be dynamically generated with CSS. We’re not going to be using these elements within our project; however, when using the universal selector it’s a good practice to also include these pseudo-elements in case they should ever appear.

  1. From there, we can use the universal selector, *, along with universal pseudo-elements, *:before and *:after, to select every imaginable element and change the box-sizing to border-box. Remember, we’re going to want to include the necessary vendor prefixes for the box-sizing property, as it is a relatively new property.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    /*
      ========================================
      Grid
      ========================================
    */
    
    *,
    *:before,
    *:after {
      -webkit-box-sizing: border-box;
         -moz-box-sizing: border-box;
              box-sizing: border-box;
    }
    
  2. Next we’ll want to create a class that will serve as a container for our elements. 

CSS vendor prefixes



For reference, the most common vendor prefixes are outlined here:
  • Mozilla Firefox: -moz-
  • Microsoft Internet Explorer: -ms-
  • Webkit (Google Chrome and Apple Safari): -webkit-

div {
  -webkit-box-sizing: content-box;
     -moz-box-sizing: content-box;
          box-sizing: content-box;
}