掲示板

adding css in content

11年前 に Abhi Ed によって更新されました。

adding css in content

Regular Member 投稿: 118 参加年月日: 12/06/04 最新の投稿
I need to modify my web content by adding css.How can I do this?
11年前 に DarshanKumar N Bhatia によって更新されました。

RE: adding css in content

Junior Member 投稿: 85 参加年月日: 10/03/02 最新の投稿
Abhi Ed:
I need to modify my web content by adding css.How can I do this?


Hi..

U can add css either in theme.

or

Within web content itself.
---------------------------------------------------------------
<style type="text/css">

h1 {font-size:36pt;}
h2 {color:blue;}
p {margin-left:50px;}

</style>
<h1>
This header is 36 pt</h1>
<h2>
This header is blue</h2>
<p>
This paragraph has a left margin of 50 pixels</p>
--------------------------------------------------------------------
HTH ....
11年前 に Abhi Ed によって更新されました。

RE: adding css in content

Regular Member 投稿: 118 参加年月日: 12/06/04 最新の投稿
DarshanKumar N Bhatia:
Abhi Ed:
I need to modify my web content by adding css.How can I do this?


Hi..

U can add css either in theme.

or

Within web content itself.
---------------------------------------------------------------
<style type="text/css">

h1 {font-size:36pt;}
h2 {color:blue;}
p {margin-left:50px;}

</style>
<h1>
This header is 36 pt</h1>
<h2>
This header is blue</h2>
<p>
This paragraph has a left margin of 50 pixels</p>
--------------------------------------------------------------------
HTH ....


Thanks Darshan!!!
Regarding declaring css in theme,I am wondering how my web content can refer to css defined in my theme's application.Like my custom css for theme resides in diffs folder.Do i need to declare the path somewhere ,if i need to use some of my theme's css in present web content??
11年前 に DarshanKumar N Bhatia によって更新されました。

RE: adding css in content

Junior Member 投稿: 85 参加年月日: 10/03/02 最新の投稿
Abhi Ed:

Do i need to declare the path somewhere ,if i need to use some of my theme's css in present web content??


No, Just define ur css in example-theme\docroot\_diffs\css\custom.css file .
Deploy Ur theme.
Apply theme to your page.
Create web content and use css with web content .(As shown earlier.)
11年前 に Abhi Ed によって更新されました。

RE: adding css in content

Regular Member 投稿: 118 参加年月日: 12/06/04 最新の投稿
DarshanKumar N Bhatia:
Abhi Ed:

Do i need to declare the path somewhere ,if i need to use some of my theme's css in present web content??


No, Just define ur css in example-theme\docroot\_diffs\css\custom.css file .
Deploy Ur theme.
Apply theme to your page.
Create web content and use css with web content .(As shown earlier.)

Hello Darshan,
I did the same.
Suppose my template contains the vm code :

<div class="welcome-block">

<h1>Welcome back ,$userFirstName</h1>

#foreach($message in $messageList)
<p>
$message.getData()
<br/>

<br/>
</p>
#end
</div>

I have declared the css class welcome-block in custom.css of my theme app.
But the final web content doesn't shows as per css definition.
Am I missing sth?
11年前 に DarshanKumar N Bhatia によって更新されました。

RE: adding css in content

Junior Member 投稿: 85 参加年月日: 10/03/02 最新の投稿
Hi,

First u have defined custom css in theme example-theme\docroot\_diffs\css\custom.css . ( Please Varify )
It should be within _diffs\css\ folder ,then it get only apply.

Check u css definition :
If u have declared like this :

#para1
{
text-align:center;
color:red;
}

Then use : <p id="para1">Hello World!</p>
Else :
if u have css defined like this
.center
{
text-align:center;
}

Then use : <p class="center">Center-aligned paragraph.</p>
Use firebug to detect what css is get applied.