Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
顏色屬性被用來設置文字的顏色。
顏色是通過CSS最經常的指定:
一個網頁的文本顏色是指在主體內的選擇:
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style>
body {
color: blue;
}
h1 {
color: #00ff00;
}
h2 {
color: rgb(255, 0, 0);
}
</style>
</head>
<body>
<h2>hello world</h2>
<h1>welcome to CaoZhou</h1>
</body>
</html>
注:對于W3C標準的CSS:如果你定義了顏色屬性,你還必須定義背景色屬性。
文本排列屬性是用來設置文本的水平對齊方式。
文本可居中或對齊到左或右,兩端對齊。
當text-align設置為"justify",每一行被展開為寬度相等,左,右外邊距是對齊(如雜志和報紙)。
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
h1 {
text-align: center;
}
p.date {
text-align: right;
}
p.main {
text-align: justify;
}
</style>
</head>
<body>
<p class="date">2015 年 3 月 14 號</p>
<p class="main"> 從前有個書生,和未婚妻約好在某年某月某日結婚。到那一天,未婚妻卻嫁給了別人。書生受此打擊, 一病不起。 這時,路過一游方僧人,從懷里摸出一面鏡子叫書生看。書生看到茫茫大海,一名遇害的女子一絲不掛地躺在海灘上。路過一人, 看一眼,搖搖頭,走了。又路過一人,將衣服脫下,給女尸蓋上,走了。再路過一人,過去,挖個坑,小心翼翼把尸體掩埋了。 僧人解釋道, 那具海灘上的女尸,就是你未婚妻的前世。你是第二個路過的人,曾給過他一件衣服。她今生和你相戀,只為還你一個情。但是她最終要報答一生一世的人,是最后那個把她掩埋的人,那人就是他現在的丈夫。書生大悟,病愈。
</p>
<p><b>注意:</b> 重置瀏覽器窗口大小查看 "justify" 是如何工作的。</p>
</body>
</html>
text-decoration 屬性用來設置或刪除文本的裝飾。
從設計的角度看 text-decoration屬性主要是用來刪除鏈接的下劃線:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.none {}
.del {
text-decoration: none;
}
</style>
</head>
<body>
<p>原來的樣子</p>
<a href="#" class="none">wwwwwwwwwwwwwwwwww</a>
<p>去掉下劃線</p>
<a href="#" class="del">wwwwwwwwwwwwwwwwwwwww</a>
</body>
</html>
也可以這樣裝飾文字:
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style>
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
</body>
</html>
注:不建議強調指出不是鏈接的文本,因為這常常混淆用戶。
text-transform文本轉換屬性是用來指定在一個文本中的大寫和小寫字母。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style>
p.uppercase {
text-transform: uppercase;
}
p.lowercase {
text-transform: lowercase;
}
p.capitalize {
text-transform: capitalize;
}
</style>
</head>
<body>
<p class="uppercase">This is some text.</p>
<p class="lowercase">This is some text.</p>
<p class="capitalize">This is some text.</p>
</body>
</html>
text-indent文本縮進屬性是用來指定文本的第一行的縮進。
p {text-indent:50px;}
增加或減少字符之間的空間。
<style>
h1 {
letter-spacing:2px;
}
h2 {
letter-spacing:-3px;
}
</style>
指定在一個段落中行之間的空間。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style>
p.small {
line-height: 70%;
}
p.big {
line-height: 200%;
}
</style>
</head>
<body>
<p>
This is a paragraph with a standard line-height.<br> This is a paragraph with a standard line-height.<br> The default line height in most browsers is about 110% to 120%.<br>
</p>
<p class="small">
This is a paragraph with a smaller line-height.<br> This is a paragraph with a smaller line-height.<br> This is a paragraph with a smaller line-height.<br> This is a paragraph with a smaller line-height.<br>
</p>
<p class="big">
This is a paragraph with a bigger line-height.<br> This is a paragraph with a bigger line-height.<br> This is a paragraph with a bigger line-height.<br> This is a paragraph with a bigger line-height.<br>
</p>
</body>
</html>
增加一個段落中的單詞之間的空白空間。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style type="text/css">
p {
word-spacing: 30px;
}
</style>
</head>
<body>
<p>
This is some text. This is some text.
</p>
</body>
</html>
設置文本的垂直對齊圖像。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style>
img{
width: 200px;
height: 100px;
}
img.top {
vertical-align: text-top;
}
img.bottom {
vertical-align: text-bottom;
}
</style>
</head>
<body>
<p>An <img src="img/logo.png" /> image with a default alignment.</p>
<p>An <img class="top" src="img/logo.png" /> image with a text-top alignment.</p>
<p>An <img class="bottom" src="img/logo.png" /> image with a text-bottom alignment.</p>
</body>
</html>
設置文本陰影。
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, user-scalable=no">
<title>項目</title>
<style>
h1{
text-shadow: 2px 2px #FF0000;
}
</style>
</head>
<body>
<h1>Text-shadow effect</h1>
</body>
</html>
本文主要介紹了CSS文本樣式實際應用中應該如何去操作,通過講解文本中對應的屬性去改變文本的表現形式。使用豐富的效果圖的展示,能夠更直觀的看到運行的效果,能夠更好的理解。使用Html語言,代碼結構更佳的清晰,能夠幫助你更好的學習。
本控件主要用來作為一個簡單的圖片瀏覽器使用,可以上下翻頁顯示圖片,圖片還可以開啟過度效果比如透明度漸變,應用場景有查看報警圖片運行圖片等。此控件非本人原創,來源于網絡,我只是修正了好多處BUG,并完善了各種操作方式。比如增加鼠標右鍵清空、增加背景色、增加鍵盤翻頁、增加移動到第一張/末一張/上一張/下一張 等,
控件沒有什么難度,主要就是打開文件夾,自動計算文件夾下的所有文件存儲到隊列中,隊列中可以是圖片的完整路徑,也可以是圖片,可以切換,如果選擇內存加載模式則會自動將路徑轉為圖片,這樣的話有個好處,就是在翻頁查看圖片的時候速度會非常的快,因為直接顯示的是內存中的圖片,而不需要重新加載路徑,畢竟路徑加載圖片又需要重新讀取硬盤。
* 1:增加鼠標右鍵清空
* 2:增加設置背景色
* 3:增加設置間距和翻頁圖標大小
* 4:增加設置是否拉伸填充顯示
* 5:增加設置是否漸變顯示圖像
* 6:增加設置鍵盤翻頁
* 7:增加移動到第一張/末一張/上一張/下一張
* 8:修正內存泄露BUG及其他BUG
ImageView::ImageView(QWidget *parent) : QWidget(parent) { setStyleSheet(".QToolButton{background-color:rgba(0,0,0,0);border-style:none;}"); bgColorStart = QColor(100, 100, 100); bgColorEnd = QColor(60, 60, 60); bottomSpace = 10; buttonSpace = 10; icoSize = QSize(65, 65); fade = false; fill = false; keyMove = false; totalNum = 0; currentIndex = -1; num = new ImageNum(this); connect(this, SIGNAL(totalNumChanged(int)), num, SLOT(setTotalNum(int))); connect(this, SIGNAL(currentIndexChanged(int)), num, SLOT(setCurrentIndex(int))); preButton = new QToolButton(this); nextButton = new QToolButton(this); preButton->setIconSize(icoSize); nextButton->setIconSize(icoSize); preButton->setIcon(QIcon(":/image/btn_pre_normal.png")); nextButton->setIcon(QIcon(":/image/btn_next_normal.png")); connect(preButton, SIGNAL(clicked()), this, SLOT(movePrevious())); connect(nextButton, SIGNAL(clicked()), this, SLOT(moveNext())); opacity = 1.0; timer = new QTimer(this); timer->setInterval(50); connect(timer, SIGNAL(timeout()), this, SLOT(doFading())); QAction *action_load = new QAction("載入", this); connect(action_load, SIGNAL(triggered(bool)), this, SLOT(load())); this->addAction(action_load); QAction *action_clear = new QAction("清空", this); connect(action_clear, SIGNAL(triggered(bool)), this, SLOT(clear())); this->addAction(action_clear); this->setContextMenuPolicy(Qt::ActionsContextMenu); calcGeo(); } ImageView::~ImageView() { if (timer->isActive()) { timer->stop(); } } void ImageView::paintEvent(QPaintEvent *) { QPainter painter(this); painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); drawBg(&painter); if (totalNum > 0) { drawImage(&painter); } } void ImageView::drawBg(QPainter *painter) { painter->save(); painter->setPen(Qt::NoPen); QLinearGradient bgGradient(QPoint(0, 0), QPoint(0, height())); bgGradient.setColorAt(0.0, bgColorStart); bgGradient.setColorAt(1.0, bgColorEnd); painter->setBrush(bgGradient); painter->drawRect(rect()); painter->restore(); } void ImageView::drawImage(QPainter *painter) { painter->save(); painter->setOpacity(opacity); if (fill) { painter->drawImage(rect(), currentImage); painter->restore(); } else { //按照比例自動居中繪制 int imageWidth = currentImage.width(); int imageHeight = currentImage.height(); int imageX = rect().center().x() - imageWidth / 2; int imageY = rect().center().y() - imageHeight / 2; QPoint point(imageX, imageY); painter->drawImage(point, currentImage); painter->restore(); } } void ImageView::keyPressEvent(QKeyEvent *keyEvent) { if (keyEvent->key() == Qt::Key_Left || keyEvent->key() == Qt::Key_Up) { movePrevious(); } else if (keyEvent->key() == Qt::Key_Right || keyEvent->key() == Qt::Key_Down) { moveNext(); } } void ImageView::resizeEvent(QResizeEvent *) { calcGeo(); } void ImageView::showEvent(QShowEvent *) { calcGeo(); } void ImageView::calcGeo() { QPoint prePoint(buttonSpace, (height() - preButton->height()) / 2); preButton->move(prePoint); QPoint nextPoint(width() - buttonSpace - preButton->width(), (height() - preButton->height()) / 2); nextButton->move(nextPoint); QPoint numPoint(width() / 2 - num->width() / 2, height() - bottomSpace - preButton->height() / 2 - num->height() / 2); num->move(numPoint); } void ImageView::doFading() { opacity += 0.05; if (opacity > 1.0) { opacity = 1.0; timer->stop(); } update(); }
1. 超過149個精美控件,涵蓋了各種儀表盤、進度條、進度球、指南針、曲線圖、標尺、溫度計、導航條、導航欄,flatui、高亮按鈕、滑動選擇器、農歷等。遠超qwt集成的控件數量。
2. 每個類都可以獨立成一個單獨的控件,零耦合,每個控件一個頭文件和一個實現文件,不依賴其他文件,方便單個控件以源碼形式集成到項目中,較少代碼量。qwt的控件類環環相扣,高度耦合,想要使用其中一個控件,必須包含所有的代碼。
3. 全部純Qt編寫,QWidget+QPainter繪制,支持Qt4.6到Qt5.12的任何Qt版本,支持mingw、msvc、gcc等編譯器,支持任意操作系統比如windows+linux+mac+嵌入式linux等,不亂碼,可直接集成到Qt Creator中,和自帶的控件一樣使用,大部分效果只要設置幾個屬性即可,極為方便。
4. 每個控件都有一個對應的單獨的包含該控件源碼的DEMO,方便參考使用。同時還提供一個所有控件使用的集成的DEMO。
5. 每個控件的源代碼都有詳細中文注釋,都按照統一設計規范編寫,方便學習自定義控件的編寫。
6. 每個控件默認配色和demo對應的配色都非常精美。
7. 超過130個可見控件,6個不可見控件。
8. 部分控件提供多種樣式風格選擇,多種指示器樣式選擇。
9. 所有控件自適應窗體拉伸變化。
10. 集成自定義控件屬性設計器,支持拖曳設計,所見即所得,支持導入導出xml格式。
11. 自帶activex控件demo,所有控件可以直接運行在ie瀏覽器中。
12. 集成fontawesome圖形字體+阿里巴巴iconfont收藏的幾百個圖形字體,享受圖形字體帶來的樂趣。
13. 所有控件最后生成一個dll動態庫文件,可以直接集成到qtcreator中拖曳設計使用。
14. 目前已經有qml版本,后期會考慮出pyqt版本,如果用戶需求量很大的話。
先準備一個適合做背景圖片的圖片,可以百度網站背景圖片,選取一張背景圖片,下載到桌面,背景圖片命名為:bj.jpg。然后登陸dedecms后臺,點擊模模塊-點擊文件管理器,選取文件管理器中的templets文件夾。
點擊進入templets文件夾,點擊defalut后進入images文件夾,上傳背景圖片bj.jpg文件。
打開網站首頁,按F12調試(1箭頭),找到控制首頁背景的css樣式表,注意找一下控制首頁的css樣式表的地址。
找到之后是可以查到是樣式html{ }在控制首頁背景(2箭頭),并找到控制首頁樣式html{ }(3箭頭)所在的地址是http://臨時域名/dede58/defalut/css/style.css,將鼠標箭頭放在箭頭3上面就可以顯示出控制背景div的css樣式。找到這個路徑的地址,去找這個控制的文件style.css,在這個文件中找到html{ } 將html{ }中的內容刪除,將以下代碼加入其中,第一個是背景圖片地址 第二個是圖片位置居中顯示 第三個是圖片不重復 第四個圖片設置固定 background-image:URL(../images/bj.jpg); background-position:center; background-repeat:no-repeat; background-attachment:fixed; 截圖所示
保存一下,各種生成,即可完成dedecms的背景圖片的設置。
*請認真填寫需求信息,我們會在24小時內與您取得聯系。