留言板

Problem with margin of the blog portlet

Marcos Laurito,修改在10 年前。

Problem with margin of the blog portlet

Junior Member 帖子: 99 加入日期: 13-4-18 最近的帖子
Im having problems trying to modify the left margin of the blog portlet content...
This margin is set by default as very big and my blog entry can't show all of its content because of that...
This next image ilustrates my problem...
Its a blog portlet inside a social office site...

Could anyone help me??

Thanks and sorry for my english..
gerald hemmers,修改在10 年前。

RE: Problem with margin of the blog portlet

Junior Member 帖子: 93 加入日期: 08-5-13 最近的帖子
Not running social office, but most of the time hunt down where the margin or padding is coming from with chrome insepct element or firefox.

Make sur that you override the class or element with the margin or padding is declared on a low level.
Css style difinition in Liferay are depenidng on othe classes so declaring it as specific as possible helped me a lot.

Greets,
gerald
thumbnail
Punam Shah,修改在10 年前。

RE: Problem with margin of the blog portlet

Regular Member 帖子: 117 加入日期: 12-1-20 最近的帖子
Hi,

Try to reset margins as -

.portlet-content {
padding-left: 2px;
}

Regards,
Punam Shah
Marcos Laurito,修改在10 年前。

RE: Problem with margin of the blog portlet

Junior Member 帖子: 99 加入日期: 13-4-18 最近的帖子
Punam Shah:
Hi,

Try to reset margins as -

.portlet-content {
padding-left: 2px;
}

Regards,
Punam Shah



ok, but where do i have to add this lines??
i assume that it is in some css file but i don't know wich one...

thanks
thumbnail
Punam Shah,修改在10 年前。

RE: Problem with margin of the blog portlet

Regular Member 帖子: 117 加入日期: 12-1-20 最近的帖子
Place the code snippet inside the custom.css

for More Info, Please visit : Create Liferay Theme ; It will help you to customize default liferay theme.

Good Luck !!!
thumbnail
Suraj Bihari,修改在10 年前。

RE: Problem with margin of the blog portlet

Junior Member 帖子: 41 加入日期: 11-5-20 最近的帖子
Hi Marcos,

Another option, without theme development, is to go to: Manage > Page. In the left pane select the Parent page "Public / Private pages". Afterwards make sure you're in the 'look and feel' section on the right side of the popup. You will find "Insert custom CSS that will be loaded after the theme." at the bottom. You can also add your css changes here.

These changes will be inherited by underlaying pages if these pages have "Use the same look and feel of the Public/Private Pages."

Then again, it's much more fun to create your own theme and put the changes in custom.css like Punam suggested, all roads lead to Rome.

Enjoy Liferay,
Suraj
Marcos Laurito,修改在10 年前。

RE: Problem with margin of the blog portlet

Junior Member 帖子: 99 加入日期: 13-4-18 最近的帖子
Suraj Bihari:
Hi Marcos,

Another option, without theme development, is to go to: Manage > Page. In the left pane select the Parent page "Public / Private pages". Afterwards make sure you're in the 'look and feel' section on the right side of the popup. You will find "Insert custom CSS that will be loaded after the theme." at the bottom. You can also add your css changes here.

These changes will be inherited by underlaying pages if these pages have "Use the same look and feel of the Public/Private Pages."

Then again, it's much more fun to create your own theme and put the changes in custom.css like Punam suggested, all roads lead to Rome.

Enjoy Liferay,
Suraj



Thanks man. I've tried this, putting the code posted above in the "Insert custom CSS that...." and checking that child pages of the site have the "Use the same look and feel.." option checked, but my blog portlet is not showing any change. The margin is not reseting to 2px...
The code that i've added is this:

.portlet-content {
padding-left: 2px;
}

Any suggestions? Any change to that code?
thumbnail
Suraj Bihari,修改在10 年前。

RE: Problem with margin of the blog portlet

Junior Member 帖子: 44 加入日期: 13-12-20 最近的帖子
Hi Marcos,

If you set the CSS to ...

.portlet-blogs .entry {
    width: 100%;
    margin: 0px;
    max-width:none;
    padding: 2px;
}


... you will see the styling change.
Add more properties to suit your needs.

Enjoy Liferay,
Suraj
thumbnail
Suraj Bihari,修改在10 年前。

RE: Problem with margin of the blog portlet

Junior Member 帖子: 41 加入日期: 11-5-20 最近的帖子
The max-width is a responsive property

HTH
Joel Jackson,修改在9 年前。

RE: Problem with margin of the blog portlet

New Member 帖子: 2 加入日期: 14-11-23 最近的帖子
To fix this, you have to know the difference between margin and padding. They behave themselves differently. First read the following tutorial: how to set margins and paddings in CSS. It has illustration on how it works and affects on each other.