Change background of rectangle without inner elements

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I have concatenated rectangles like so:



usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture


The result of the above is this:



enter image description here



My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)







share|improve this question






















  • Welcome to TeX.SE! Does adding fill=white to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B; and then fill the big node on the background layer.
    – marmot
    Sep 3 at 17:32











  • Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
    – ojenn
    Sep 3 at 17:34















up vote
3
down vote

favorite












I have concatenated rectangles like so:



usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture


The result of the above is this:



enter image description here



My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)







share|improve this question






















  • Welcome to TeX.SE! Does adding fill=white to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B; and then fill the big node on the background layer.
    – marmot
    Sep 3 at 17:32











  • Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
    – ojenn
    Sep 3 at 17:34













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I have concatenated rectangles like so:



usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture


The result of the above is this:



enter image description here



My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)







share|improve this question














I have concatenated rectangles like so:



usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture


The result of the above is this:



enter image description here



My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)









share|improve this question













share|improve this question




share|improve this question








edited Sep 3 at 17:36

























asked Sep 3 at 17:27









ojenn

474




474











  • Welcome to TeX.SE! Does adding fill=white to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B; and then fill the big node on the background layer.
    – marmot
    Sep 3 at 17:32











  • Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
    – ojenn
    Sep 3 at 17:34

















  • Welcome to TeX.SE! Does adding fill=white to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B; and then fill the big node on the background layer.
    – marmot
    Sep 3 at 17:32











  • Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
    – ojenn
    Sep 3 at 17:34
















Welcome to TeX.SE! Does adding fill=white to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B; and then fill the big node on the background layer.
– marmot
Sep 3 at 17:32





Welcome to TeX.SE! Does adding fill=white to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B; and then fill the big node on the background layer.
– marmot
Sep 3 at 17:32













Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
– ojenn
Sep 3 at 17:34





Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
– ojenn
Sep 3 at 17:34











1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










Too long for a comment.



documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument


enter image description here






share|improve this answer




















  • Thanks so much it works now!
    – ojenn
    Sep 3 at 17:39






  • 3




    Of course. It was just asking me to wait..
    – ojenn
    Sep 3 at 17:54










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f449151%2fchange-background-of-rectangle-without-inner-elements%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










Too long for a comment.



documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument


enter image description here






share|improve this answer




















  • Thanks so much it works now!
    – ojenn
    Sep 3 at 17:39






  • 3




    Of course. It was just asking me to wait..
    – ojenn
    Sep 3 at 17:54














up vote
3
down vote



accepted










Too long for a comment.



documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument


enter image description here






share|improve this answer




















  • Thanks so much it works now!
    – ojenn
    Sep 3 at 17:39






  • 3




    Of course. It was just asking me to wait..
    – ojenn
    Sep 3 at 17:54












up vote
3
down vote



accepted







up vote
3
down vote



accepted






Too long for a comment.



documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument


enter image description here






share|improve this answer












Too long for a comment.



documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 3 at 17:35









marmot

56.2k461123




56.2k461123











  • Thanks so much it works now!
    – ojenn
    Sep 3 at 17:39






  • 3




    Of course. It was just asking me to wait..
    – ojenn
    Sep 3 at 17:54
















  • Thanks so much it works now!
    – ojenn
    Sep 3 at 17:39






  • 3




    Of course. It was just asking me to wait..
    – ojenn
    Sep 3 at 17:54















Thanks so much it works now!
– ojenn
Sep 3 at 17:39




Thanks so much it works now!
– ojenn
Sep 3 at 17:39




3




3




Of course. It was just asking me to wait..
– ojenn
Sep 3 at 17:54




Of course. It was just asking me to wait..
– ojenn
Sep 3 at 17:54

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f449151%2fchange-background-of-rectangle-without-inner-elements%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke