よく使うスタイル

  • 投稿日:
  • by

Sitesで追加したスタイル

2013よりBootstrapを採用。アイコンglyphiconを使う。新規にglyphicon.cssを作成した。ただしsitesでは、その一部をstyle.cssに追加した。〔例〕<i class="icon-firefox"></i>

sites/all/themes/sigma/style.css( 印刷用スタイルは misc/print.css)でサイト共通のスタイルを定義する。雛形

<div class="alist"> Link1 Link2 Link3 </div>

内部リンク <id="navy">  外部リンク <id="maroon">   外部リンク <class="elink">
※すべてのTargetをexternalにしたいときは、<base target="external">を使う

大項目 <h1 class="hdr">

中項目 <h2 class="hdr">

枠飾りのある項目名 <h3 class="hdr3">

先頭に画像を使った段落 <p class="star12">

枠線で囲む <div class="box">

<ul class="star">

  • 先頭マークに画像 star.gif 使用 <ul class="star">
  • 字下げ 2em

<ul class="ulink">

<ol class="elink">

<p class="list4">

朱色4点マークの項目、段落  ああああああああ

<a class="download"…>Download

<span id="firefox">Firefox</span>  (同様に id="opera"、 id="ie7")
FirefoxOperaSafariIE7

<a class="popup" href="http://agorian.com/img/sample.jpg">  Sample1 </a>
<a class="popup" rel="width:400;height:300;" href="http://agorian.com/img/sample.jpg"> Sample2 </a>

/* <td> 画像の縦位置を上に設定 */
td img { vertical-align:top; }

/* Display:table */
#table { width:auto; display:table;}
#cell { display:table-cell; padding:5px;}

雛形CSS

/* $Id: style.css,v 1.23 2007/12/17 15:05:09 goba Exp $ */

/*
** HTML elements
*/
body {
  margin: 0;
  padding: 0;
  color: #000;
  background-color: #fff;
  font: 76% Verdana, Arial, Helvetica, sans-serif;
}
tr.odd td, tr.even td {
  padding: 0.3em;
}
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
}
h1 {
  font-size: 1.3em;
}
h2 {
  font-size: 1.2em;
}
h3, h4, h5, h6 {
  font-size: 1.1em;
}
p {
  margin-top: 0.5em;
  margin-bottom: 0.9em;
}
a {
  text-decoration: none;
  font-weight: bold;
}
a:link {
  color: #39c;
}
a:visited {
  color: #369;
}
a:hover {
  color: #39c;
  text-decoration: underline;
}
fieldset {
  border: 1px solid #ccc;
}
pre {
  background-color: #eee;
  padding: 0.75em 1.5em;
  font-size: 12px;
  border: 1px solid #ddd;
}
table {
  /* make <td> sizes relative to body size! */
  font-size: 1em;
}
.form-item label {
  font-size: 1em;
  color: #222;
}
.item-list .title {
  font-size: 1em;
  color: #222;
}
.links {
  margin-bottom: 0;
}
.comment .links {
  margin-bottom: 0;
}

/*
** Page layout blocks / IDs
*/
#header, #content {
  width: 100%;
}
#header {
  background-color: #69c;
}
#logo {
  vertical-align: middle;
  border: 0;
}
#logo img {
  float: left; /* LTR */
  padding: 0 1em;
  border: 0;
}
#menu {
  padding: 0.5em 0.5em 0 0.5em; /* LTR */
  text-align: right; /* LTR */
  vertical-align: middle;
}
#navlist {
  font-size: 1.0em;
  padding: 0 0.8em 1.2em 0; /* LTR */
  color: #9cf;
}
#navlist a {
  font-weight: bold;
  color: #fff;
}
#subnavlist {
  padding: 0.5em 1.2em 0.4em 0; /* LTR */
  font-size: 0.8em;
  color: #9cf;
}
#subnavlist a {
  font-weight: bold;
  color: #9cf;
}
ul.links li {
  border-left: 1px solid #9cf; /* LTR */
}
ul.links li.first {
  border: none;
}
#search .form-text, #search .form-submit {
  border: 1px solid #369;
  font-size: 1.1em;
  height: 1.5em;
  vertical-align: middle;
}
#search .form-text {
  width: 8em;
  padding: 0 0.5em;
}
#mission {
  background-color: #369;
  padding: 1.5em 2em;
  color: #fff;
}
#mission a, #mission a:visited {
  color: #9cf;
  font-weight: bold;
}
.site-name {
  margin: 0.6em 0 0 ;
  padding: 0;
  font-size: 2em;
}
.site-name a:link, .site-name a:visited {
  color: #fff;
}
.site-name a:hover {
  color: #369;
  text-decoration: none;
}
.site-slogan {
  font-size: 1em;
  color: #eee;
  display: block;
  margin: 0;
  font-style: italic;
  font-weight: bold;
}
#main {
  /* padding in px not ex because IE messes up 100% width tables otherwise */
  padding: 10px;
}
#mission, .node .content, .comment .content {
  line-height: 1.4em;
}
#help {
  font-size: 0.9em;
  margin-bottom: 1em;
}
.breadcrumb {
  margin-bottom: .5em;
}
.messages {
  background-color: #eee;
  border: 1px solid #ccc;
  padding: 0.3em;
  margin-bottom: 1em;
}
.error {
  border-color: red;
}
#sidebar-left, #sidebar-right {
  background-color: #ddd;
  width: 16em;
  /* padding in px not ex because IE messes up 100% width tables otherwise */
  padding: 10px;
  vertical-align: top;
}
#footer {
  background-color: #eee;
  padding: 1em;
  font-size: 0.8em;
}

/*
** Common declarations for child classes of node, comment, block, box, etc.
** If you want any of them styled differently for a specific parent, add
** additional rules /with only the differing properties!/ to .parent .class.
** See .comment .title for an example.
*/
.title, .title a {
  font-weight: bold;
  font-size: 1.3em;
  color: #777;
  margin: 0 auto;  /* decrease default margins for h<x>.title */
}
.submitted {
  color: #999;
  font-size: 0.8em;
}
.links {
  color: #999;
}
.links a {
  font-weight: bold;
}
.block, .box {
  padding: 0 0 1.5em 0; /* LTR */
}
.block {
  border-bottom: 1px solid #bbb;
  padding-bottom: 0.75em;
  margin-bottom: 1.5em;
}
.block .title {
  margin-bottom: .25em;
}
.box .title {
  font-size: 1.1em;
}
.node {
  margin: .5em 0 2em; /* LTR */
}
.sticky {
  padding: .5em;
  background-color: #eee;
  border: solid 1px #ddd;
}
.node .content, .comment .content {
  margin: .5em 0 .5em;
}
.node .taxonomy {
  color: #999;
  font-size: 0.8em;
  padding-left: 1.5em; /* LTR */
}
.node .picture {
  border: 1px solid #ddd;
  float: right; /* LTR */
  margin: 0.5em;
}
.comment {
  border: 1px solid #abc;
  padding: .5em;
  margin-bottom: 1em;
}
.comment .title a {
  font-size: 1.1em;
  font-weight: normal;
}
.comment .new {
  text-align: right; /* LTR */
  font-weight: bold;
  font-size: 0.8em;
  float: right; /* LTR */
  color: red;
}
.comment .picture {
  border: 1px solid #abc;
  float: right; /* LTR */
  margin: 0.5em;
}

/*
** Module specific styles
*/
#aggregator .feed-source {
  background-color: #eee;
  border: 1px solid #ccc;
  padding: 1em;
  margin: 1em 0;
}
#aggregator .news-item .categories, #aggregator .source, #aggregator .age {
  color: #999;
  font-style: italic;
  font-size: 0.9em;
}
#aggregator .title {
  margin-bottom: 0.5em;
  font-size: 1em;
}
#aggregator h3 {
  margin-top: 1em;
}
#forum table {
  width: 100%;
}
#forum td {
  padding: 0.5em;
}
#forum td.forum, #forum td.posts {
  background-color: #eee;
}
#forum td.topics, #forum td.last-reply {
  background-color: #ddd;
}
#forum td.container {
  background-color: #ccc;
}
#forum td.container a {
  color: #555;
}
#forum td.statistics, #forum td.settings, #forum td.pager {
  height: 1.5em;
  border: 1px solid #bbb;
}
#forum td .name {
  color: #96c;
}
#forum td .links {
  padding-top: 0.7em;
  font-size: 0.9em;
}
#profile .profile {
  clear: both;
  border: 1px solid #abc;
  padding: .5em;
  margin: 1em 0em;
}
#profile .profile .name {
  padding-bottom: 0.5em;
}
.block-forum h3 {
  margin-bottom: .5em;
}
div.admin-panel .description {
  color: #999;
}
div.admin-panel .body {
  background: #f4f4f4;
}
div.admin-panel h3 {
  background-color: #69c;
  color: #fff;
  padding: 5px 8px 5px;
  margin: 0;
}

/* A Lists : リンク先の先頭アイコンをgreen.gifにする */
.alist a { background: url(http://agorian.com/icon/ls/green.gif) no-repeat ; padding:0 0 0 12px; }
.box {
  background-color: #fafafa;
  padding: 0.5em 1em;
  font-size: 12px;
  border: 1px solid gray;
}

.star12 { background:url(http://agorian.com/img/star.gif) no-repeat;
  padding-left:12px;}

.photo   {  border: #cacab8 1px solid; padding: 2px; background: #fff; margin: 0pt 10px 5px 0pt; float: left; text-align: center;}

ul.star  { list-style:url(http://agorian.com/img/star.gif); padding : 0px; margin-left : 3em;}

ul.ulink { list-style:url(http://agorian.com/img/link.gif); padding-left:3em; }

a.elink { color:maroon; }
.elink a { color:maroon; }
ul#blue { list-style:url(http://agorian.com/img/link.gif); padding-left:3em; }

.link { background:url(http://agorian.com/img/link.gif) no-repeat; padding-left:15px; }

#white {color:white;}
#navy { background:url(http://agorian.com/img/link.gif) no-repeat; padding-left:15px; color:navy;}
#maroon { background:url(http://agorian.com/img/link.gif) no-repeat; padding-left:15px; color:maroon;}
a.externalLink { color:maroon;}
a:hover.externalLink,a:hover#maroon { color:orange;}
a:hover#navy  { color:skyblue;}

#star { background:url(http://agorian.com/img/star.gif) no-repeat;
  padding-left:12px;}
#blog { background:url(http://agorian.com/img/blog.gif) no-repeat;
  padding-left:14px;}

.blog { background:url(http://agorian.com/img/blog.gif) no-repeat; padding-left:15px; }

.list4 { background:url(http://agorian.com/icon/ls/4orange.gif) no-repeat;padding-left:12px; }

.HDR3 { font-size: 1.1em; padding: 2px; background: #eee;
  border-left: solid #4a4d4a 5px; border-bottom: solid #4a4d4a 1px;}

.download { background:url(http://agorian.com/help/img/download.gif) no-repeat; padding-left:15px; }

#firefox {background: url(http://agorian.com/icon/browser.png) 0px 2px no-repeat;font-size:14px;padding-left:15px;}
#opera {background: url(http://agorian.com/icon/browser.png) 0px -15px no-repeat;font-size:14px;padding-left:15px;}
#safari {background: url(http://agorian.com/icon/browser.png) 0px -30px no-repeat;font-size:14px;padding-left:15px;}
#ie7 {background: url(http://agorian.com/icon/browser.png) 0px -45px no-repeat;font-size:14px;padding-left:15px;}