Foren

Problem with margin of the blog portlet

Marcos Laurito, geändert vor 10 Jahren.

Problem with margin of the blog portlet

Junior Member Beiträge: 99 Beitrittsdatum: 18.04.13 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Junior Member Beiträge: 93 Beitrittsdatum: 13.05.08 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Regular Member Beiträge: 117 Beitrittsdatum: 20.01.12 Neueste Beiträge
Hi,

Try to reset margins as -

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

Regards,
Punam Shah
Marcos Laurito, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Junior Member Beiträge: 99 Beitrittsdatum: 18.04.13 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Regular Member Beiträge: 117 Beitrittsdatum: 20.01.12 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Junior Member Beiträge: 41 Beitrittsdatum: 20.05.11 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Junior Member Beiträge: 99 Beitrittsdatum: 18.04.13 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Junior Member Beiträge: 44 Beitrittsdatum: 20.12.13 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Problem with margin of the blog portlet

Junior Member Beiträge: 41 Beitrittsdatum: 20.05.11 Neueste Beiträge
The max-width is a responsive property

HTH
Joel Jackson, geändert vor 9 Jahren.

RE: Problem with margin of the blog portlet

New Member Beiträge: 2 Beitrittsdatum: 23.11.14 Neueste Beiträge
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.